Beispiel #1
0
 public GameBoard(GameRules rules)
 {
     GameRules = rules;
     BoardSize = GameConstants.boardSize;
     Board     = new int[BoardSize, BoardSize];
     InitBoard();
 }
Beispiel #2
0
        //public List<Tuple<int, int>> posibleMoves = new List<Tuple<int, int>>();

        public GameManager()
        {
            GameRules      = new GameRules();
            GameBoard      = new GameBoard(GameRules);
            GameHistory    = new Stack <List <int> >(1000);
            RedoStack      = new Stack <List <int> >(1000);
            GameInProgress = false;
            Input          = "";
        }
Beispiel #3
0
        public int CheckKingSiege(GameBoard board, int row, int col)
        {
            int sieged = 0;
            List <List <int> > adjacted = GameRules.Adjacted(row, col, board);

            foreach (List <int> position in adjacted)
            {
                if (board.Enemy(row, col, position[0], position[1]) && !board.IsKing(position[0], position[1]))
                {
                    sieged = 20;
                }
            }
            return(sieged);
        }
Beispiel #4
0
        public int KingHunting(GameBoard board, int row, int col)
        {
            int hunt = 0;
            List <List <int> > adjacted = GameRules.Adjacted(row, col, board);

            foreach (List <int> position in adjacted)
            {
                if (board.Enemy(row, col, position[0], position[1]) && board.IsKing(position[0], position[1]))
                {
                    hunt += 2;
                }
            }
            return(hunt);
        }
Beispiel #5
0
 private void CheckEndGame()
 {
     if (GameRules.EGFrozenKings(GameBoard))
     {
         GameStatus = "draw";
         Console.WriteLine("Frozen Kings.");
         EndGame();
     }
     if (GameRules.EGRoyalLine(GameBoard))
     {
         GameStatus = Enum.ToObject(typeof(PlayerColor), PlayerOnTurn.PlayerColor).ToString() + " Player Win!";
         Console.WriteLine("King on Royal Line.");
         EndGame();
     }
     if (GameRules.EGEnemyBlocked(GameBoard, PlayerOnTurn))
     {
         GameStatus = Enum.ToObject(typeof(PlayerColor), PlayerOnTurn.PlayerColor).ToString() + " Player Win!";
         Console.WriteLine("Enemy Blocked.");
         EndGame();
     }
 }
Beispiel #6
0
 public BrainAI()
 {
     Min   = GameConstants.min;
     Max   = GameConstants.max;
     Rules = new GameRules();
 }