Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Java 

Finite State Machine Help!

Im trying to implement a finite state machine to handle the AI of my game's AI. Ive implemented finite state machine in c++ before using function pointers but i do not know how to do it in java due to lack of these. If you could help, please pm me or message me on skype: imomniscient
Im a bit busy at the moment, but i just found this which might be of interest to you:
http://stackoverflow.com/questions/13221...ne-in-java
You could use an enum of states, and each AI can base its actions on the State it is in.
You can replicate function pointers with lambdas or interfaces.
(Mar 17, 2014 03:34 AM)Ben121 Wrote:  You can replicate function pointers with lambdas or interfaces.

You can only use lambdas if you are using java 8 🙂


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Python] by Blackshield_realMay 13, 2018 03:21 AM 0 64 May 13, 2018 03:21 AM
Last Post: Blackshield_real
[C] by Zinedine ZidaneMay 28, 2017 04:20 AM 0 130 May 28, 2017 04:20 AM
Last Post: Zinedine Zidane
[.NET] by ice001Nov 13, 2013 11:02 AM 1 96 Nov 13, 2013 11:02 AM
Last Post: PsychoSexy