Пример #1
0
        public void Dispose()
        {
            for (int i = 0; i < 16; i += 1)
            {
                if (m_state_sink_array[i] != null)
                {
                    m_state_sink_array[i] = null;
                }
            }
            m_state_sink_array.Clear();

            int j = 0;

            while (j < 64)
            {
                if (m_state_array[j] != null)
                {
                    m_state_array[j] = null;
                }
                j++;
            }
            this.m_state_array.Clear();

            if (mAllStateListener != null)
            {
                mAllStateListener.Free();
                mAllStateListener = null;
            }
        }
Пример #2
0
 protected void ClearCallbackInfo()
 {
     if (this.m_listner != null)
     {
         this.m_listner.Free();
     }
     this.m_listner = null;
 }
Пример #3
0
 public void SetListener(LuaFunction enter_func, LuaFunction exit_func)
 {
     if (this.mAllStateListener != null)
     {
         this.mAllStateListener.Free();
         this.mAllStateListener = null;
     }
     this.mAllStateListener = new ScriptAllStateListner(this, enter_func, exit_func);
 }
Пример #4
0
        public GameState(GameStateMachine parent_machine, uint state_id, string state_name, ushort sink_id, StateComposeType sct)
        {
            this.m_parent_machine = parent_machine;
            this.m_state_id       = state_id;
            this.m_state_name     = state_name;
            this.m_sink_id        = sink_id;
            this.m_compose_type   = sct;

            this.m_action_flag     = uint.MaxValue;
            this.m_can_re_enter    = false;
            this.m_is_state_lock   = false;
            this.m_listner         = null;
            this.m_parent_state_id = ushort.MaxValue;
        }
Пример #5
0
        public GameStateMachine()
        {
            mAllStateListener = null;
            //初始化分支
            for (ushort i = 0; i < SINK_ID_CAPACITY; i++)
            {
                m_free_sink_id_list.Add(i);
                m_state_sink_array.Add(null);
            }

            //初始化状态
            for (ushort i = 0; i < STATE_ID_CAPACITY; i++)
            {
                m_free_state_id_list.Add(i);
                m_state_array.Add(null);
            }
        }
Пример #6
0
 public void SetCallbackAsCListner(IGameStateListner listner)
 {
     this.ClearCallbackInfo();
     this.m_listner = listner;
 }