Beispiel #1
0
        public void Act(BaseAction action)
        {
            for (int i = 0; i < m_actionQueue.Count; ++i)
            {
                BaseAction c = m_actionQueue[i];
                if (c.Connect(action))
                {
                    ObjectPools.CheckIn(action);
                    return;
                }
                else if (c.CanReplace(action))
                {
                    ObjectPools.CheckIn(c);
                    action.Prepare();
                    m_actionQueue[i] = action;
                    return;
                }
            }

            m_actionQueue.Add(action);
            if (m_actionQueue.Count == 1)
            {
                action.Prepare();
            }
        }
Beispiel #2
0
 public void Clear()
 {
     foreach (KeyValuePair <int, BaseBomb> bomb in m_dicBombs)
     {
         ObjectPools.CheckIn(bomb.Value);
     }
     m_dicBombs.Clear();
 }
Beispiel #3
0
 public void CheckIn(CharacterLogic pCharacter)
 {
     if (OnCharacterDelete != null)
     {
         OnCharacterDelete(pCharacter);
     }
     ObjectPools.CheckIn(pCharacter);
 }
Beispiel #4
0
 public void Clear()
 {
     foreach (BaseAction action in m_actionQueue)
     {
         action.Cancel();
         ObjectPools.CheckIn(action);
     }
     m_actionQueue.Clear();
 }
Beispiel #5
0
 public void DeleteBomb(int uid)
 {
     if (m_dicBombs.ContainsKey(uid))
     {
         BaseBomb pBombData = m_dicBombs[uid];
         if (OnBombDelete != null)
         {
             OnBombDelete(pBombData, true);
         }
         ObjectPools.CheckIn(pBombData);
         m_dicBombs.Remove(uid);
     }
 }
Beispiel #6
0
 public void Execute()
 {
     if (m_actionQueue.Count > 0)
     {
         BaseAction c = m_actionQueue[0];
         if (!c.isFinished)
         {
             c.Execute();
         }
         else
         {
             ObjectPools.CheckIn(c);
             m_actionQueue.RemoveAt(0);
             if (m_actionQueue.Count > 0)
             {
                 m_actionQueue[0].Prepare();
             }
         }
     }
 }