Пример #1
0
 /// <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);
 }
Пример #2
0
 public BasicModelAgent(Object worldObject, BasicState startState) : base(worldObject, startState)
 {
 }
Пример #3
0
 /// <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;
 }