示例#1
0
        public void ExcludeCreature(Creature _creature)
        {
            _creature.ClearActPool();
            var liveMapCell = _creature[0, 0];

            liveMapCell.ResetCached();
            var info = InfoByCreature[_creature];

            OutOfScope.Add(_creature, info);
            InfoByCreature.Remove(_creature);

            PointByCreature.Remove(info);
            if (_creature is AbstractDummyCreature)
            {
                if (!DummyCreatureByPoint[info.WorldCoords].Remove(info))
                {
                    throw new ApplicationException();
                }
            }
            else
            {
                if (!CreatureByPoint.Remove(info.WorldCoords))
                {
                    throw new ApplicationException();
                }

                info.Layer[liveMapCell.MapBlockId].CreaturesAdd(_creature, liveMapCell.InBlockCoords);
            }

            info[0, 0].ResetCached();
            info.LiveCoords = null;
        }
示例#2
0
        public void CreatureIsDead(Creature _creature)
        {
            var info = InfoByCreature[_creature];

            _creature[0, 0].ResetCached();
            _creature.GeoInfo = null;
            _creature.ClearActPool();
            InfoByCreature.Remove(_creature);
            OutOfScope.Remove(_creature);
            if (!PointByCreature.Remove(info))
            {
                throw new ApplicationException();
            }

            if (_creature is AbstractDummyCreature)
            {
                if (!DummyCreatureByPoint[info.WorldCoords].Remove(info))
                {
                    throw new ApplicationException();
                }
            }
            else
            {
                if (!CreatureByPoint.Remove(info.WorldCoords))
                {
                    throw new ApplicationException();
                }
            }
        }