Britbot
static bool Britbot.Commander.IsDefensive ( ) [inline, static]

Checks if the Commander is in defensive or or offensive mode.

Returns:

Definition at line 585 of file Commander.cs.

        {
            double ePPT = Math.Floor(Math.Pow(2, Bot.Game.EnemyIslands().Count - 1));
            double myPPT = Math.Floor(Math.Pow(2, Bot.Game.MyIslands().Count - 1));

            double eN = Bot.Game.GetEnemyScore();
            double myN = Bot.Game.GetMyScore();

            double maxTurns = 1000;

            double turnUntilEnemy = (maxTurns - eN) / ePPT;
            double turnUntilMe = (maxTurns - myN) / myPPT;

            if (turnUntilMe < turnUntilEnemy - 50)
                return true;
            return false;
        }