Esempio n. 1
0
        public static void Main(string[] args)
        {
            Dictionary<Coords, PieceType> p1Moves = new Dictionary<Coords, PieceType>(){
                {new Coords(){x = 4, y = 1}, PieceType.ROUND},
                {new Coords(){x = 4, y = 2}, PieceType.ROUND},
                {new Coords(){x = 4, y = 3}, PieceType.SQUARE},
                {new Coords(){x = 4, y = 4}, PieceType.SQUARE},
                {new Coords(){x = 3, y = 2}, PieceType.SQUARE}
            };

             GameMaster master = new GameMaster();
             master.Reset();

             foreach (Coords coord in p1Moves.Keys)
             {
            master.Turn.Control().Place(p1Moves[coord], coord);
             }

             AIEngine ai = new AIEngine(master);
             ai.DebugFn = Debug;

             ai.Act("Placement");
             ai.Instructions.ForEach( i => i());
             master.Turn.Control().Skip();
             master.Turn.Control().Skip();

             ai.Act("Movement");
             ai.Instructions.ForEach(i => i());
             Console.ReadLine();
        }
Esempio n. 2
0
        public void PlayOutOneTurn()
        {
            Dictionary<Coords,PieceType> p1Moves = new Dictionary<Coords,PieceType> (){
                {new Coords(){x = 4, y = 1}, PieceType.ROUND},
                {new Coords(){x = 4, y = 2}, PieceType.ROUND},
                {new Coords(){x = 4, y = 3}, PieceType.SQUARE},
                {new Coords(){x = 4, y = 4}, PieceType.SQUARE},
                {new Coords(){x = 3, y = 2}, PieceType.SQUARE}
            };

            GameMaster master = new GameMaster ();
            master.Reset ();

            foreach (Coords coord in p1Moves.Keys)
            {
            master.Turn.Control ().Place (p1Moves [coord], coord);
            }

            AIEngine ai = new AIEngine (master);
            ai.Act ("Placement");

            master.Turn.Control ().Skip ();
            master.Turn.Control ().Skip ();

            ai.Act ("Movement");
        }
Esempio n. 3
0
        /// <summary>
        /// Redirects to the static Board AIClone method, is required as the client has no Board reference
        /// </summary>			
        public static Board AIClone(GameMaster master)
        {
            Board newBoard = Board.AIClone (master.Board);

            return newBoard;
        }
Esempio n. 4
0
 public AIEngine(GameMaster master)
 {
     Master = master;
     DB = RaptorDB<string>.Open (System.IO.Path.GetFullPath (DB_PATH), false);
 }