Britbot
Simulator/ReviveEvent.cs
Go to the documentation of this file.
00001 using System;
00002 using System.Collections.Generic;
00003 using System.Linq;
00004 using System.Text;
00005 using System.Threading.Tasks;
00006 using Pirates;
00007 namespace Britbot.Simulator
00008 {
00009     class ReviveEvent : SimulatedEvent
00010     {
00014         public SimulatedGroup GroupToRevive;
00015 
00016         public ReviveEvent(int turn, SimulatedGroup groupToRevive) : base(turn)
00017         {
00018             this.GroupToRevive = groupToRevive;
00019         }
00020 
00021         //revive group
00022         public override bool Activate(SimulatedGame sg)
00023         {
00024             this.GroupToRevive.IsAlive = true;
00025             if (this.GroupToRevive.Owner == Consts.ME)
00026                 sg.MyDeadPirates -= this.GroupToRevive.FirePower;
00027             else
00028                 sg.EnemyDeadPirates -= this.GroupToRevive.FirePower;
00029 
00030             return false;
00031         }
00032     }
00033 }