/// <summary> /// This method changes the current state to a new state. /// </summary> /// <param name="state">State to change to</param> public virtual void ChangeState(BasicState state) { // Exit this state. currentState.Exit(this); // Set the new state. currentState = state; // Call the new states Enter method. currentState.Enter(this); }
public BasicModelAgent(Object worldObject, BasicState startState) : base(worldObject, startState) { }
/// <summary> /// Agent Contructor /// </summary> /// <param name="worldObject">Object this agent is associated with.</param> /// <param name="startState">Starting State</param> public BasicAgent(Object worldObject, BasicState startState) { this.worldObject = worldObject; currentState = startState; }