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 IFsm <T> CreateFsm <T>(string name, T owner, List <FsmState <T> > states) where T : class { TypeNamePair typeNamePair = new TypeNamePair(typeof(T), name); if (HasFsm <T>(name)) { throw new Exception(string.Format("Already exist FSM '{0}'.", typeNamePair)); } Fsm <T> fsm = Fsm <T> .Create(name, owner, states); m_FsmMap.Add(typeNamePair, fsm); return(fsm); }
private bool InternalHasFsm(TypeNamePair typeNamePair) { return(m_FsmMap.ContainsKey(typeNamePair)); }