protected override MoveValuation EvaluateMove(int choice)
        {
            int currentPoints = this.gameData.CountPoints(this.playerId);

            Game.Engine.Game afterTurn = this.gameData.Clone();
            afterTurn.ChooseTurn(choice, this.playerId);

            int afterPoints = afterTurn.CountPoints(this.playerId);

            return(new MoveValuation()
            {
                Choice = choice,
                Weight = afterPoints - currentPoints,
            });
        }
Esempio n. 2
0
        private bool IWin(Game.Engine.Game game)
        {
            GameStats stats = this.gameData.GetGameStats();

            switch (this.gameData.GetCurrentTurn()) // my color
            {
            case TileType.yellow:
                return(stats.YellowCount > stats.BlueCount && stats.YellowCount > stats.RedCount);

            case TileType.blue:
                return(stats.BlueCount > stats.YellowCount && stats.BlueCount > stats.RedCount);

            case TileType.red:
                return(stats.RedCount > stats.YellowCount && stats.RedCount > stats.BlueCount);
            }
            return(false);
        }
Esempio n. 3
0
        protected override MoveValuation EvaluateMove(int choice)
        {
            Game.Engine.Game afterMove = this.gameData.Clone();
            afterMove.ChooseTurn(choice, this.playerId);

            if (afterMove.GameOver && IWin(afterMove))
            {
                return(new MoveValuation()
                {
                    Choice = choice, Weight = 100
                });
            }

            return(new MoveValuation()
            {
                Choice = choice, Weight = 0
            });
        }
Esempio n. 4
0
 public GameOverStrategy(Game.Engine.Game gameData, Guid playerId)
     : base(gameData, playerId)
 {
 }
 public DefaultFortressStrategy(Game.Engine.Game gameData, Guid playerId)
 {
     this.gameData = gameData;
     this.playerId = playerId;
 }
Esempio n. 6
0
 public DefaultFortressStrategy(Game.Engine.Game gameData, Guid playerId)
 {
     this.gameData = gameData;
     this.playerId = playerId;
 }
 public FieldPositionStrategy(Game.Engine.Game gameData, Guid playerId)
     : base(gameData, playerId)
 {
 }
Esempio n. 8
0
 public KillPlayerTurnStrategy(Game.Engine.Game gameData, Guid playerId)
     : base(gameData, playerId)
 {
 }
 public PreventNeighbourStrategy(Game.Engine.Game gameData, Guid playerId)
     : base(gameData, playerId)
 {
 }
 public PointCountStrategy(Game.Engine.Game gameData, Guid playerId)
     : base(gameData, playerId)
 {
 }