Beispiel #1
0
        public int[] BoardToNumberPattern(GammonInterface game)
        {
            int[] result = new int[26];

            for (int i = 0; i < game.BoardSquareCount; i++)
            {
                if (game.SquareOwner(i) == game.CurrentPlayer)
                {
                    result[i] = game.SquareCheckerCount(i);
                }
                else if (game.SquareOwner(i) == game.CurrentOpponentPlayer)
                {
                    result[i] = -(game.SquareCheckerCount(i));
                }
                else
                {
                    result[i] = 0;
                }
            }
            return(result);
        }
Beispiel #2
0
 private void FindSingleMoves(BgMoveList moveList, int val)
 {
     for (int i = m_BgGame.BoardSquareCount - 1; i > 0; i--)
     {
         if (m_BgGame.SquareOwner(i) == m_BgGame.CurrentPlayer)
         {
             if (m_BgGame.ValidateMove(i, i - val))
             {
                 BgMove move = new BgMove(i, i - val, null);
                 moveList.AddBgMove(move);
             }
         }
         if (i <= 6 && m_BgGame.ValidateMove(i, 26))
         {
             BgMove move = new BgMove(i, 26, null);
             moveList.AddBgMove(move);
         }
     }
 }