Пример #1
0
 /// <summary>
 /// Receives information about objects death and remove it from attacker group.
 /// </summary>
 /// <param name="igo">The death object.</param>
 /// <param name="m">The death argument.</param>
 private void OnAttackerDieEvent(IGameObject igo, MyDieArgs m)
 {
     var imgo = igo as IMovableGameObject;
     if (imgo != null) {
         RemoveFromDeffenderTarget(imgo);
     }
 }
Пример #2
0
 /// <summary>
 /// Receives information about objects death and remove it from deffender group.
 /// </summary>
 /// <param name="igo">The death object.</param>
 /// <param name="m">The death argument.</param>
 private void OnDeffenderDieEvent(IGameObject igo, MyDieArgs m)
 {
     var imgo = igo as IMovableGameObject;
     if (imgo != null) {
         // IMovableGameObject
         RemoveFromAttackerTarget(imgo);
     } else {
         var isgo = igo as IStaticGameObject;
         if (isgo != null) {
             // IStaticGameObject
             RemoveFromAttackerTarget(isgo);
         }
     }
 }
 /// <summary>
 /// Ensures delete of the death game object and prints information about its death to game console.
 /// </summary>
 /// <param name="igo">The death game object.</param>
 /// <param name="m">The arguments contains information about death.</param>
 private void OnDieEvent(IGameObject igo, MyDieArgs m)
 {
     Game.PrintToGameConsole(igo.Name + " destroyed (Team " + igo.Team.Name + ").");
     RemoveObject(igo);
 }