Esempio n. 1
0
    public void ChangeState(IMinionState newState)
    {
        currentState?.Exit();
        currentState = newState;
        currentState.Enter(owner);

        //If we get a new state given to us we should drop what we are doing and enter the new state
        if (owner.CurrentJob != null && newState.Status == MinionStatus.Reproducing)
        {
            owner.CurrentJob.CancelJob();
        }
    }
Esempio n. 2
0
 public StateMachine(Minion owner, IMinionState startingState)
 {
     this.owner = owner;
     ChangeState(startingState);
 }