예제 #1
0
        private void IntToMove()
        {
            int mask = 255;

            byte i = (byte)(mask & SerializedMove);

            mask <<= 8;
            byte x = (byte)((mask & SerializedMove) >> 8);

            mask <<= 8;
            byte y = (byte)((mask & SerializedMove) >> 16);

            mask <<= 8;
            byte v = (byte)((mask & SerializedMove) >> 24);

            _Piece         = Pieces.GetImmutablePieces()[i - 1];
            _Position      = new PiecePosition(x, y);
            _VariantNumber = v;
        }
예제 #2
0
 public void SetElementAt(PiecePosition point, Player value)
 {
     BoardElements[point.X, point.Y] = value;
 }
예제 #3
0
 public Player GetElementAt(PiecePosition point)
 {
     return(BoardElements[point.X, point.Y]);
 }
예제 #4
0
 public PiecePosition(PiecePosition position)
 {
     X = position.X;
     Y = position.Y;
 }
예제 #5
0
        private static BoardCell GetBoardExtCell(BoardCell[,] boardExt, PiecePosition piecePos, PiecePosition square)
        {
            int x = square.X + piecePos.X;
            int y = square.Y + piecePos.Y;

            if (x < 0 || y < 0 || x >= Board.BoardSize || y >= Board.BoardSize)
            {
                return(BoardCell.OutOfBoard);
            }
            return(boardExt[x, y]);
        }