libgdx / gdx-ai

Artificial Intelligence framework for games based on libGDX or not. Features: Steering Behaviors, Formation Motion, Pathfinding, Behavior Trees and Finite State Machines
Apache License 2.0
1.2k stars 242 forks source link

possible fix to issue #80 #82

Closed patrick1964 closed 7 years ago

patrick1964 commented 7 years ago

hi i added an overloading constructor that allows an addition of specified timepiece to the Wander.java class. this is my first ever contribution to any real project so please give feedback if there are any issues with the changes

davebaol commented 7 years ago

Unfortunately the proposed solution won't work properly because GdxAI.setTimepiece(timepiece) stores the timepiece in a static field. This means that all wander instances will use the timepiece set by the last instantiated wander behavior.

patrick1964 commented 7 years ago

ok so would it be possible to have a timepiece dynamic field in the wanderer class that is declared as =GdxAI.getTimepiece(); but is mutable based on the constuctor? if you would like i would be happy to write it if you think it might work.