Beispiel #1
0
        private FsmBase InternalGetFsm(TypeNamePair typeNamePair)
        {
            FsmBase fsm = null;

            if (m_FsmMap.TryGetValue(typeNamePair, out fsm))
            {
                return(fsm);
            }

            return(null);
        }
Beispiel #2
0
        private bool InternalDestroyFsm(TypeNamePair typeNamePair)
        {
            FsmBase fsm = null;

            if (m_FsmMap.TryGetValue(typeNamePair, out fsm))
            {
                fsm.Shutdown();
                return(m_FsmMap.Remove(typeNamePair));
            }

            return(false);
        }
Beispiel #3
0
        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);
        }
Beispiel #4
0
 private bool InternalHasFsm(TypeNamePair typeNamePair)
 {
     return(m_FsmMap.ContainsKey(typeNamePair));
 }