Пример #1
0
 public override void RemoveFromGame(GameTime gameTime)
 {
     this.IsAlive = false;
     if (this.Owner == Owners.ENEMY)
     {
         if (TargetEntity == null)
         {
             this.Game.Enemy.AddPath(UnitType.INFANTRY, this.VisitedPath);
         }
         else
         {
             this.Game.Enemy.AddPath(TargetEntity.unitType, this.VisitedPath);
         }
     }
     this.Game.DynamicEntityList.Remove(this);
     this.Location.Occupant = null;
     if (TargetEntity != null)
     {
         TargetEntity.State = States.STOPPED;
         //TargetEntity.OldState = States.NONE;
         TargetEntity.Update(gameTime);
         TargetEntity.TargetEntity = null;
     }
     if (TargetTown != null)
     {
         TargetTown.TargetEntity = null;
     }
 }