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

updates the island if event is actual

Parameters:
sg

Implements Britbot.Simulator.SimulatedEvent.

Definition at line 42 of file CaptureEvent.cs.

        {
            //check if this event is still actual
            if (!this.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 != this.Capturer.Owner)
            {
                if (this.Capturer.Owner == Consts.ME)
                    sg.MyIslandCount += this.Island.Value;
                if (this.Capturer.Owner == Consts.ENEMY)
                    sg.EnemyIslandCount += this.Island.Value;

                this.Island.Owner = this.Capturer.Owner;
            }

            return false;
        }