Class State<T>

  • Type Parameters:
    T - the entity template

    public abstract class State<T>
    extends java.lang.Object
    Check out the State for more details
    Author:
    kong
    • Constructor Summary

      Constructors 
      Constructor Description
      State()  
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      abstract void enter​(T entity)
      This will execute when the state is entered
      abstract void execute​(T entity)
      This is the state's normal update function
      abstract void exit​(T entity)
      This will execute when the state is exited
      abstract boolean onMessage​(T entity, Telegram msg)
      This executes if the agent receives a message from the message dispatcher, see MessageDispatcher
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • State

        public State()
    • Method Detail

      • enter

        public abstract void enter​(T entity)
        This will execute when the state is entered
        Parameters:
        entity - the current entity
      • execute

        public abstract void execute​(T entity)
        This is the state's normal update function
        Parameters:
        entity - the current entity
      • exit

        public abstract void exit​(T entity)
        This will execute when the state is exited
        Parameters:
        entity - the current entity
      • onMessage

        public abstract boolean onMessage​(T entity,
                                          Telegram msg)
        This executes if the agent receives a message from the message dispatcher, see MessageDispatcher
        Parameters:
        entity - the current entity
        msg - the message that sent to this current entity
        Returns:
        true if the message was sent successful, false otherwise