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; }
public void SetElementAt(PiecePosition point, Player value) { BoardElements[point.X, point.Y] = value; }
public Player GetElementAt(PiecePosition point) { return(BoardElements[point.X, point.Y]); }
public PiecePosition(PiecePosition position) { X = position.X; Y = position.Y; }
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]); }