public ValidateChessPieceMoveRequest( ChessPieceKind chessPieceKind, ChessboardPositionDto currentPosition, ChessboardPositionDto targetPosition) { ChessPieceKind = chessPieceKind; CurrentPosition = currentPosition; TargetPosition = targetPosition; }
public static ChessboardState CreateFromMoves( ChessboardPositionDto currentPosition, IEnumerable <ChessboardPositionDto> targetPositions) { var chessboard = new[] { new[] { _, _, _, _, _, _, _, _ }, new[] { _, _, _, _, _, _, _, _ }, new[] { _, _, _, _, _, _, _, _ }, new[] { _, _, _, _, _, _, _, _ }, new[] { _, _, _, _, _, _, _, _ }, new[] { _, _, _, _, _, _, _, _ }, new[] { _, _, _, _, _, _, _, _ }, new[] { _, _, _, _, _, _, _, _ } }; chessboard[currentPosition.Y][currentPosition.X] = C; foreach (var targetPosition in targetPositions) { chessboard[targetPosition.Y][targetPosition.X] = A; } return(new ChessboardState(chessboard)); }
public GetChessPiecePossibleMovesRequest( ChessboardPositionDto chessboardPosition, ChessPieceKind chessPieceKind) { ChessboardPosition = chessboardPosition; ChessPieceKind = chessPieceKind; }
protected bool Equals(ChessboardPositionDto other) { return(X == other.X && Y == other.Y); }
public GetChessPiecePossibleMovesResponse( ChessboardPositionDto currentPosition, IEnumerable <ChessboardPositionDto> possibleMoves) { CurrentPosition = currentPosition; PossibleMoves = possibleMoves; }