Britbot
override bool Britbot.Simulator.DeCaptureEvent.Activate ( SimulatedGame  sg) [inline, virtual]

updates the island if event is actual

Parameters:
sg

Implements Britbot.Simulator.SimulatedEvent.

Definition at line 47 of file DeCaptureEvent.cs.

        {
            //check if this event is still actuall
            if (!Capturer.IsAlive)
                return false;

            if (this.Island.CapturingGroup != this.Capturer)
                return false;

            //check that the island realy of the enemy
            if (this.Island.Owner == this.Capturer.Owner)
                return false;

            //if everything checks out update island
            
            if (this.Island.Owner == Consts.ME)
                sg.MyIslandCount -= this.Island.Value;
            if (this.Island.Owner == Consts.ENEMY)
                sg.EnemyIslandCount -= this.Island.Value;
                        
            this.Island.Owner = Consts.NO_OWNER;
            this.Island.TurnsBeingCaptured = 0;

            //set out a capture event
            int captureTurn = sg.CurrentTurn + Bot.Game.Islands()[0].CaptureTurns;
            sg.AddEvent(new CaptureEvent(captureTurn, this.Island, this.Capturer));

            return false;
        }