public bool DestroyFsm(FsmBase fsm) { if (fsm == null) { throw new Exception("FSM is invalid."); } return(InternalDestroyFsm(new TypeNamePair(fsm.OwnerType, fsm.Name))); }
private FsmBase InternalGetFsm(TypeNamePair typeNamePair) { FsmBase fsm = null; if (m_FsmMap.TryGetValue(typeNamePair, out fsm)) { return(fsm); } return(null); }
private bool InternalDestroyFsm(TypeNamePair typeNamePair) { FsmBase fsm = null; if (m_FsmMap.TryGetValue(typeNamePair, out fsm)) { fsm.Shutdown(); return(m_FsmMap.Remove(typeNamePair)); } return(false); }
public FsmBase[] GetAllFsms() { int index = 0; FsmBase[] results = new FsmBase[m_FsmMap.Count]; foreach (KeyValuePair <TypeNamePair, FsmBase> fsm in m_FsmMap) { results[index++] = fsm.Value; } return(results); }