public void DeleteTransition(BotanyTransition trans) { if (mMap.ContainsKey(trans) == false) { return; } mMap.Remove(trans); }
public BotanyStateID GetOutPutState(BotanyTransition trans) { if (mMap.ContainsKey(trans) == false) { return(BotanyStateID.NullState); } else { return(mMap[trans]); } }
public void AddTransition(BotanyTransition trans, BotanyStateID id) { if (trans == BotanyTransition.NullTansition) { return; } if (id == BotanyStateID.NullState) { return; } if (mMap.ContainsKey(trans)) { return; } mMap.Add(trans, id); }
public void PerformTransition(BotanyTransition trans) { if (trans == BotanyTransition.NullTansition) { return; } BotanyStateID nextStateID = CurrentState.GetOutPutState(trans); if (nextStateID == BotanyStateID.NullState) { return; } foreach (IBotanyState s in mStates) { if (s.stateID == nextStateID) { currentState.DoBeforeLeaving(); currentState = s; currentState.DoBeforeEntering(); return; } } }