Beispiel #1
0
        public void RemoveMonster(Monster monsterCom, bool ingoreBroad = false)
        {
            m_Monsters.Remove(monsterCom);
            m_MonsterCount--;
            m_RealCountCount--;
            m_WaveMgr.RemoveMonster();
            int guid      = monsterCom.GetGuid();
            int monsterId = monsterCom.GetMonsterId();

            if (!ingoreBroad)
            {
                m_WaveMgr.RecordKillMonster(monsterId);
                Global.gApp.gMsgDispatcher.Broadcast <int, int, Monster>(MsgIds.MonsterDead, guid, monsterId, monsterCom);
            }
            if (m_MonsterCount <= 0)// m_RealCountCount == 0 is also ok
            {
                Global.gApp.gMsgDispatcher.Broadcast <int, int>(MsgIds.WaveEnded, m_Guid, m_WaveData.id);
                m_WaveMgr.RemoveWave(m_Guid);
            }
        }