From 790eee67b7fbbceb1d66109c1f1679a23d40b7ac Mon Sep 17 00:00:00 2001 From: Rudy Alex Kohn Date: Thu, 27 Jun 2024 23:36:10 +0200 Subject: [PATCH] re-arrange src files structure in a more vertical friendly way --- Rudzoft.ChessLib.sln | 119 ++--- .../Icon => icon}/ChessLib.png | Bin .../BenchBitOp1.txt | 0 .../Rudzoft.ChessLib.Benchmark/BitOpBench.cs | 0 .../CharConvertBenchmark.cs | 0 .../FenBenchmark.cs | 0 .../InBetweenBenchmark.cs | 0 .../IsNumericBenchmark.cs | 0 .../IterateBenchmark.cs | 0 .../KeyBenchmarks.cs | 0 .../KnightMoveGenerateBenchmark.cs | 0 .../MagicBBInitBenchmark.cs | 0 .../MoveGeneratorBenchmark.cs | 0 .../MoveGeneratorBenchmarkInfo.md | 0 .../NumberCompactingBenchmark.cs | 0 .../Rudzoft.ChessLib.Benchmark/PerftBench.cs | 0 .../Rudzoft.ChessLib.Benchmark/Program.cs | 0 .../Rudzoft.ChessLib.Benchmark.csproj | 4 +- .../ShiftFuncBench.cs | 0 .../SquareIterateBenchmark.cs | 0 .../StringBenchmarks.cs | 0 .../Rudzoft.ChessLib.Benchmark/Usings.cs | 0 .../PgnMoveNotationTests/SanToMoveTests.cs | 0 .../PgnTests/PgnTests.cs | 0 .../Rudzoft.ChessLib.PGN.Test.csproj | 2 +- .../Rudzoft.ChessLib.PGN.Test/Usings.cs | 0 .../samples/sample.pgn | 0 .../Rudzoft.ChessLib.PGN/IPgnParser.cs | 0 .../Rudzoft.ChessLib.PGN/NonRegexPgnParser.cs | 0 .../Rudzoft.ChessLib.PGN/PgnGame.cs | 0 .../Rudzoft.ChessLib.PGN/PgnGenerator.cs | 0 .../Rudzoft.ChessLib.PGN/PgnMove.cs | 0 .../PgnParserServiceCollectionExtensions.cs | 0 .../Rudzoft.ChessLib.PGN/RegexPgnParser.cs | 0 .../Rudzoft.ChessLib.PGN.csproj | 0 .../IPerft.cs | 0 .../PerftPosition.cs | 0 .../Rudzoft.ChessLib.Perft.Interfaces.csproj | 0 .../Rudzoft.ChessLib.Perft/Perft.cs | 0 .../PerftPositionFactory.cs | 0 .../Rudzoft.ChessLib.Perft/PerftTable.cs | 0 .../Rudzoft.ChessLib.Perft.csproj | 0 .../BitboardTests/BitboardDataTests.cs | 0 .../BitboardTests/BitboardTests.cs | 0 .../BitboardTests/LineTests.cs | 0 .../BitboardTests/MbbTests.cs | 0 .../BoardTests/BoardTests.cs | 346 +++++++------- .../BookTests/BookFixture.cs | 0 .../BookTests/PolyglotTests.cs | 0 .../BookTests/gm2600.bin | Bin .../CastleTests/BasicCastleTests.cs | 0 .../CastleTests/CastleRightTests.cs | 0 .../DataTests/DataTests.cs | 0 .../DataTests/PieceSquareTests.cs | 0 .../DataTests/RecordHashTests.cs | 0 .../DataTests/StringExtensionsTests.cs | 0 .../EvaluationTests/KpkBitBaseTests.cs | 0 .../FENTests/FenTests.cs | 0 .../FenceTests/FenceTests.cs | 0 .../FileTests/FileEdgeDistanceTests.cs | 0 .../FileTests/FileTests.cs | 0 .../GameplayTests/FoolsCheckMateTests.cs | 0 .../MateTests/MateTests.cs | 0 .../MaterialTests/MaterialTests.cs | 0 .../MoveTests/MoveGen_49.cs | 0 .../MoveTests/MoveGeneratorTests.cs | 0 .../MoveTests/MoveTests.cs | 0 .../NotationTests/FanTests.cs | 270 +++++------ .../NotationTests/IccfTests.cs | 182 ++++---- .../NotationTests/RanTests.cs | 190 ++++---- .../NotationTests/SanTests.cs | 436 +++++++++--------- .../Rudzoft.ChessLib.Test/NumberTests.cs | 0 .../PerftTests/PerftTest.cs | 0 .../PerftTests/PerftTheoryData.cs | 0 .../PerftTests/PerftVerify.cs | 0 .../PiecesTests/PawnDoubleAttackTests.cs | 0 .../PiecesTests/PawnPushTests.cs | 0 .../PiecesTests/PieceAttacks.cs | 0 .../PiecesTests/PieceAttacksBishopTests.cs | 0 .../PiecesTests/PieceAttacksKingTests.cs | 0 .../PiecesTests/PieceAttacksKnightTests.cs | 0 .../PiecesTests/PieceAttacksPawnTests.cs | 0 .../PiecesTests/PieceAttacksRookTests.cs | 0 .../PiecesTests/RegularMobilityFixture.cs | 0 .../PiecesTests/SliderMobilityFixture.cs | 0 .../PiecesTests/SliderMobilityTests.cs | 0 .../PositionTests/EnPassantFenTests.cs | 0 .../PositionTests/PositionTests.cs | 0 .../PositionTests/ValidationTests.cs | 0 .../ProtocolTests/OptionsTests.cs | 116 ++--- .../ProtocolTests/SearchParameterTests.cs | 0 .../ProtocolTests/UciTests.cs | 0 .../RankTests/RankEdgeDistanceTests.cs | 0 .../Rudzoft.ChessLib.Test.csproj | 0 .../ScoreTests/ScoreTests.cs | 0 .../SizesTests/BaseTypesSizeTests.cs | 0 .../SquareTests/DistanceTests.cs | 0 .../SquareTests/SquareFromStringTests.cs | 0 .../SquareTests/SquareRangeTests.cs | 0 .../SquareTests/SquareTests.cs | 0 .../TablesTests/KillerMovesTests.cs | 0 .../Rudzoft.ChessLib.Test/Usings.cs | 0 .../ZobristTests/ZobristHashTests.cs | 0 .../Rudzoft.ChessLib.Test/xunit.runner.json | 0 .../Rudzoft.ChessLib/Blockage.cs | 0 src/{ => chess-lib}/Rudzoft.ChessLib/Board.cs | 0 .../Rudzoft.ChessLib/Cuckoo.cs | 0 .../Rudzoft.ChessLib/Enums/ChessMode.cs | 0 .../Rudzoft.ChessLib/Enums/GameEndTypes.cs | 0 .../Rudzoft.ChessLib/Enums/GameResults.cs | 0 .../Rudzoft.ChessLib/Enums/MoveAmbiguities.cs | 0 .../Enums/MoveGenerationTypes.cs | 0 .../Rudzoft.ChessLib/Enums/Phases.cs | 0 .../Evaluation/IKpkBitBase.cs | 0 .../Rudzoft.ChessLib/Evaluation/KpkBitBase.cs | 0 .../Exceptions/InvalidFenException.cs | 0 .../Exceptions/InvalidMove.cs | 0 .../Exceptions/InvalidSquare.cs | 0 .../Exceptions/TranspositionTableFailure.cs | 0 .../Extensions/ArrayExtensions.cs | 0 .../ChessLibServiceCollectionExtensions.cs | 0 .../Extensions/MathExtensions.cs | 0 .../Rudzoft.ChessLib/Extensions/Maths.cs | 0 .../Extensions/PieceExtensions.cs | 0 .../Extensions/SpanExtensions.cs | 0 .../Extensions/StringExtensions.cs | 0 .../Factories/IKillerMovesFactory.cs | 0 .../Factories/IPolyglotBookFactory.cs | 0 .../Factories/IServiceFactory.cs | 0 .../Factories/KillerMovesFactory.cs | 0 .../Factories/PolyglotBookFactory.cs | 0 .../Factories/ServiceFactory.cs | 0 .../Rudzoft.ChessLib/Fen/Fen.cs | 0 .../Rudzoft.ChessLib/Fen/FenData.cs | 0 .../Rudzoft.ChessLib/Fen/IFenData.cs | 0 src/{ => chess-lib}/Rudzoft.ChessLib/Game.cs | 0 .../Rudzoft.ChessLib/GlobalSuppressions.cs | 0 .../Rudzoft.ChessLib/Hash/IRKiss.cs | 0 .../Rudzoft.ChessLib/Hash/IZobrist.cs | 0 .../Rudzoft.ChessLib/Hash/RKiss.cs | 0 .../Hash/Tables/Transposition/Bound.cs | 0 .../Transposition/ITranspositionTable.cs | 0 .../Hash/Tables/Transposition/PertT.cs | 0 .../Transposition/TranspositionTable.cs | 0 .../TranspositionTableConfiguration.cs | 0 .../Transposition/TranspositionTableEntry.cs | 0 .../Rudzoft.ChessLib/Hash/Zobrist.cs | 0 .../Rudzoft.ChessLib/IBlockage.cs | 0 .../Rudzoft.ChessLib/IBoard.cs | 0 .../Rudzoft.ChessLib/ICuckoo.cs | 0 src/{ => chess-lib}/Rudzoft.ChessLib/IGame.cs | 0 .../Rudzoft.ChessLib/IPosition.cs | 0 .../Rudzoft.ChessLib/IValues.cs | 0 .../MoveGeneration/MoveFactory.cs | 0 .../MoveGeneration/MoveGenerator.cs | 0 .../MoveGeneration/MoveList.cs | 0 .../Notation/IMoveNotation.cs | 0 .../Notation/INotationToMove.cs | 0 .../Rudzoft.ChessLib/Notation/MoveNotation.cs | 0 .../Notation/NotationToMove.cs | 0 .../Notation/Notations/CoordinateNotation.cs | 0 .../Notation/Notations/FanNotation.cs | 0 .../Notation/Notations/INotation.cs | 0 .../Notation/Notations/IccfNotation.cs | 0 .../Notation/Notations/LanNotation.cs | 0 .../Notation/Notations/Notation.cs | 0 .../Notation/Notations/RanNotation.cs | 0 .../Notation/Notations/SanNotation.cs | 0 .../Notation/Notations/SmithNotation.cs | 0 .../Notation/Notations/UciNotation.cs | 0 .../Polyglot/IPolyglotBook.cs | 0 .../Rudzoft.ChessLib/Polyglot/PolyglotBook.cs | 0 .../Polyglot/PolyglotBookConfiguration.cs | 0 .../Polyglot/PolyglotBookEntry.cs | 0 .../Polyglot/PolyglotBookZobrist.cs | 0 .../ReverseEndianBinaryStreamReader.cs | 0 .../Rudzoft.ChessLib/Position.cs | 0 .../Rudzoft.ChessLib/Protocol/UCI/Clock.cs | 0 .../Protocol/UCI/CopyProtections.cs | 0 .../Rudzoft.ChessLib/Protocol/UCI/Cpu.cs | 0 .../Protocol/UCI/HiResTimer.cs | 0 .../Protocol/UCI/HiResTimerArgs.cs | 0 .../Rudzoft.ChessLib/Protocol/UCI/ICpu.cs | 0 .../Protocol/UCI/IHiResTimer.cs | 0 .../Protocol/UCI/IInputOutput.cs | 0 .../Protocol/UCI/IMovesToGoModel.cs | 0 .../Rudzoft.ChessLib/Protocol/UCI/IOption.cs | 0 .../Protocol/UCI/ISearchParameters.cs | 0 .../Rudzoft.ChessLib/Protocol/UCI/IUci.cs | 0 .../Protocol/UCI/InputOutput.cs | 0 .../Protocol/UCI/InputOutputAction.cs | 0 .../Protocol/UCI/MovesToGoModel.cs | 0 .../Rudzoft.ChessLib/Protocol/UCI/Option.cs | 0 .../Protocol/UCI/OptionComparer.cs | 0 .../Protocol/UCI/SearchParameters.cs | 0 .../Protocol/UCI/UCIProtocol.html | 0 .../Rudzoft.ChessLib/Protocol/UCI/Uci.cs | 0 .../Protocol/UCI/UciOptionType.cs | 0 .../Rudzoft.ChessLib/Rudzoft.ChessLib.csproj | 16 +- src/{ => chess-lib}/Rudzoft.ChessLib/State.cs | 0 .../Rudzoft.ChessLib/Tables/HashTable.cs | 0 .../Tables/History/HistoryHeuristic.cs | 0 .../Tables/History/IHistoryHeuristic.cs | 0 .../Rudzoft.ChessLib/Tables/IHashTable.cs | 0 .../Rudzoft.ChessLib/Tables/ITableEntry.cs | 0 .../Tables/KillerMoves/IKillerMoves.cs | 0 .../Tables/KillerMoves/KillerMoves.cs | 0 .../Tables/Perft/IPerftTableEntry.cs | 0 .../Tables/Perft/PerftTable.cs | 0 src/{ => chess-lib}/Rudzoft.ChessLib/ToDo.md | 0 .../Rudzoft.ChessLib/TroubledFens.txt | 0 .../Rudzoft.ChessLib/Types/BitBoard.cs | 0 .../Rudzoft.ChessLib/Types/BitBoards.cs | 0 .../Rudzoft.ChessLib/Types/CastleRight.cs | 0 .../Rudzoft.ChessLib/Types/Color.cs | 0 .../Rudzoft.ChessLib/Types/Depth.cs | 0 .../Rudzoft.ChessLib/Types/Direction.cs | 0 .../Rudzoft.ChessLib/Types/File.cs | 0 .../Rudzoft.ChessLib/Types/HashKey.cs | 0 .../Rudzoft.ChessLib/Types/IPieceSquare.cs | 0 .../Rudzoft.ChessLib/Types/IValidationType.cs | 0 .../Rudzoft.ChessLib/Types/MagicBB.cs | 0 .../Rudzoft.ChessLib/Types/Move.cs | 0 .../Rudzoft.ChessLib/Types/Piece.cs | 0 .../Rudzoft.ChessLib/Types/PieceSquare.cs | 6 +- .../Types/PieceSquareEventArgs.cs | 0 .../Rudzoft.ChessLib/Types/PieceType.cs | 0 .../Rudzoft.ChessLib/Types/Rank.cs | 0 .../Rudzoft.ChessLib/Types/RootMove.cs | 88 ++-- .../Rudzoft.ChessLib/Types/Score.cs | 0 .../Rudzoft.ChessLib/Types/Square.cs | 0 .../Rudzoft.ChessLib/Types/StateStack.cs | 0 .../Rudzoft.ChessLib/Types/ValMove.cs | 0 .../Rudzoft.ChessLib/Types/Value.cs | 0 .../Rudzoft.ChessLib/Types/Values.cs | 0 .../Validation/IPositionValidator.cs | 0 .../Validation/PositionValidationResult.cs | 0 .../Validation/PositionValidator.cs | 0 src/perft/Rudzoft.Perft/Rudzoft.Perft.csproj | 5 +- .../Rudzoft.ChessLib.WebApi/.dockerignore | 0 .../Controllers/MovesController.cs | 0 .../Controllers/PgnController.cs | 0 .../Rudzoft.ChessLib.WebApi/Dockerfile | 0 .../Rudzoft.ChessLib.WebApi/Moves.cs | 0 .../Rudzoft.ChessLib.WebApi/Program.cs | 0 .../Properties/launchSettings.json | 0 .../Queries/MoveQuery.cs | 0 .../Rudzoft.ChessLib.WebApi.csproj | 7 +- .../Services/IMoveGeneratorService.cs | 0 .../Services/MoveGeneratorService.cs | 0 .../appsettings.Development.json | 0 .../Rudzoft.ChessLib.WebApi/appsettings.json | 0 252 files changed, 898 insertions(+), 889 deletions(-) rename {src/Rudzoft.ChessLib/Icon => icon}/ChessLib.png (100%) rename src/{ => chess-lib.bench}/Rudzoft.ChessLib.Benchmark/BenchBitOp1.txt (100%) rename src/{ => chess-lib.bench}/Rudzoft.ChessLib.Benchmark/BitOpBench.cs (100%) rename src/{ => chess-lib.bench}/Rudzoft.ChessLib.Benchmark/CharConvertBenchmark.cs (100%) rename src/{ => chess-lib.bench}/Rudzoft.ChessLib.Benchmark/FenBenchmark.cs (100%) rename src/{ => chess-lib.bench}/Rudzoft.ChessLib.Benchmark/InBetweenBenchmark.cs (100%) rename src/{ => chess-lib.bench}/Rudzoft.ChessLib.Benchmark/IsNumericBenchmark.cs (100%) rename src/{ => chess-lib.bench}/Rudzoft.ChessLib.Benchmark/IterateBenchmark.cs (100%) rename src/{ => chess-lib.bench}/Rudzoft.ChessLib.Benchmark/KeyBenchmarks.cs (100%) rename src/{ => chess-lib.bench}/Rudzoft.ChessLib.Benchmark/KnightMoveGenerateBenchmark.cs (100%) rename src/{ => chess-lib.bench}/Rudzoft.ChessLib.Benchmark/MagicBBInitBenchmark.cs (100%) rename src/{ => chess-lib.bench}/Rudzoft.ChessLib.Benchmark/MoveGeneratorBenchmark.cs (100%) rename src/{ => chess-lib.bench}/Rudzoft.ChessLib.Benchmark/MoveGeneratorBenchmarkInfo.md (100%) rename src/{ => chess-lib.bench}/Rudzoft.ChessLib.Benchmark/NumberCompactingBenchmark.cs (100%) rename src/{ => chess-lib.bench}/Rudzoft.ChessLib.Benchmark/PerftBench.cs (100%) rename src/{ => chess-lib.bench}/Rudzoft.ChessLib.Benchmark/Program.cs (100%) rename src/{ => chess-lib.bench}/Rudzoft.ChessLib.Benchmark/Rudzoft.ChessLib.Benchmark.csproj (56%) rename src/{ => chess-lib.bench}/Rudzoft.ChessLib.Benchmark/ShiftFuncBench.cs (100%) rename src/{ => chess-lib.bench}/Rudzoft.ChessLib.Benchmark/SquareIterateBenchmark.cs (100%) rename src/{ => chess-lib.bench}/Rudzoft.ChessLib.Benchmark/StringBenchmarks.cs (100%) rename src/{ => chess-lib.bench}/Rudzoft.ChessLib.Benchmark/Usings.cs (100%) rename src/{ => chess-lib.pgn}/Rudzoft.ChessLib.PGN.Test/PgnMoveNotationTests/SanToMoveTests.cs (100%) rename src/{ => chess-lib.pgn}/Rudzoft.ChessLib.PGN.Test/PgnTests/PgnTests.cs (100%) rename src/{ => chess-lib.pgn}/Rudzoft.ChessLib.PGN.Test/Rudzoft.ChessLib.PGN.Test.csproj (88%) rename src/{ => chess-lib.pgn}/Rudzoft.ChessLib.PGN.Test/Usings.cs (100%) rename src/{ => chess-lib.pgn}/Rudzoft.ChessLib.PGN.Test/samples/sample.pgn (100%) rename src/{ => chess-lib.pgn}/Rudzoft.ChessLib.PGN/IPgnParser.cs (100%) rename src/{ => chess-lib.pgn}/Rudzoft.ChessLib.PGN/NonRegexPgnParser.cs (100%) rename src/{ => chess-lib.pgn}/Rudzoft.ChessLib.PGN/PgnGame.cs (100%) rename src/{ => chess-lib.pgn}/Rudzoft.ChessLib.PGN/PgnGenerator.cs (100%) rename src/{ => chess-lib.pgn}/Rudzoft.ChessLib.PGN/PgnMove.cs (100%) rename src/{ => chess-lib.pgn}/Rudzoft.ChessLib.PGN/PgnParserServiceCollectionExtensions.cs (100%) rename src/{ => chess-lib.pgn}/Rudzoft.ChessLib.PGN/RegexPgnParser.cs (100%) rename src/{ => chess-lib.pgn}/Rudzoft.ChessLib.PGN/Rudzoft.ChessLib.PGN.csproj (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Perft.Interfaces/IPerft.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Perft.Interfaces/PerftPosition.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Perft.Interfaces/Rudzoft.ChessLib.Perft.Interfaces.csproj (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Perft/Perft.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Perft/PerftPositionFactory.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Perft/PerftTable.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Perft/Rudzoft.ChessLib.Perft.csproj (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/BitboardTests/BitboardDataTests.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/BitboardTests/BitboardTests.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/BitboardTests/LineTests.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/BitboardTests/MbbTests.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/BoardTests/BoardTests.cs (97%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/BookTests/BookFixture.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/BookTests/PolyglotTests.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/BookTests/gm2600.bin (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/CastleTests/BasicCastleTests.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/CastleTests/CastleRightTests.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/DataTests/DataTests.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/DataTests/PieceSquareTests.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/DataTests/RecordHashTests.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/DataTests/StringExtensionsTests.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/EvaluationTests/KpkBitBaseTests.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/FENTests/FenTests.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/FenceTests/FenceTests.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/FileTests/FileEdgeDistanceTests.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/FileTests/FileTests.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/GameplayTests/FoolsCheckMateTests.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/MateTests/MateTests.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/MaterialTests/MaterialTests.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/MoveTests/MoveGen_49.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/MoveTests/MoveGeneratorTests.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/MoveTests/MoveTests.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/NotationTests/FanTests.cs (97%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/NotationTests/IccfTests.cs (97%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/NotationTests/RanTests.cs (97%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/NotationTests/SanTests.cs (97%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/NumberTests.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/PerftTests/PerftTest.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/PerftTests/PerftTheoryData.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/PerftTests/PerftVerify.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/PiecesTests/PawnDoubleAttackTests.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/PiecesTests/PawnPushTests.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/PiecesTests/PieceAttacks.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/PiecesTests/PieceAttacksBishopTests.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/PiecesTests/PieceAttacksKingTests.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/PiecesTests/PieceAttacksKnightTests.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/PiecesTests/PieceAttacksPawnTests.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/PiecesTests/PieceAttacksRookTests.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/PiecesTests/RegularMobilityFixture.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/PiecesTests/SliderMobilityFixture.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/PiecesTests/SliderMobilityTests.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/PositionTests/EnPassantFenTests.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/PositionTests/PositionTests.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/PositionTests/ValidationTests.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/ProtocolTests/OptionsTests.cs (97%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/ProtocolTests/SearchParameterTests.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/ProtocolTests/UciTests.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/RankTests/RankEdgeDistanceTests.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/Rudzoft.ChessLib.Test.csproj (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/ScoreTests/ScoreTests.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/SizesTests/BaseTypesSizeTests.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/SquareTests/DistanceTests.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/SquareTests/SquareFromStringTests.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/SquareTests/SquareRangeTests.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/SquareTests/SquareTests.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/TablesTests/KillerMovesTests.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/Usings.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/ZobristTests/ZobristHashTests.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib.Test/xunit.runner.json (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Blockage.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Board.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Cuckoo.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Enums/ChessMode.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Enums/GameEndTypes.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Enums/GameResults.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Enums/MoveAmbiguities.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Enums/MoveGenerationTypes.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Enums/Phases.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Evaluation/IKpkBitBase.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Evaluation/KpkBitBase.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Exceptions/InvalidFenException.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Exceptions/InvalidMove.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Exceptions/InvalidSquare.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Exceptions/TranspositionTableFailure.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Extensions/ArrayExtensions.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Extensions/ChessLibServiceCollectionExtensions.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Extensions/MathExtensions.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Extensions/Maths.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Extensions/PieceExtensions.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Extensions/SpanExtensions.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Extensions/StringExtensions.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Factories/IKillerMovesFactory.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Factories/IPolyglotBookFactory.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Factories/IServiceFactory.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Factories/KillerMovesFactory.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Factories/PolyglotBookFactory.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Factories/ServiceFactory.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Fen/Fen.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Fen/FenData.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Fen/IFenData.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Game.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/GlobalSuppressions.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Hash/IRKiss.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Hash/IZobrist.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Hash/RKiss.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Hash/Tables/Transposition/Bound.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Hash/Tables/Transposition/ITranspositionTable.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Hash/Tables/Transposition/PertT.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Hash/Tables/Transposition/TranspositionTable.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Hash/Tables/Transposition/TranspositionTableConfiguration.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Hash/Tables/Transposition/TranspositionTableEntry.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Hash/Zobrist.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/IBlockage.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/IBoard.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/ICuckoo.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/IGame.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/IPosition.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/IValues.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/MoveGeneration/MoveFactory.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/MoveGeneration/MoveGenerator.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/MoveGeneration/MoveList.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Notation/IMoveNotation.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Notation/INotationToMove.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Notation/MoveNotation.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Notation/NotationToMove.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Notation/Notations/CoordinateNotation.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Notation/Notations/FanNotation.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Notation/Notations/INotation.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Notation/Notations/IccfNotation.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Notation/Notations/LanNotation.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Notation/Notations/Notation.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Notation/Notations/RanNotation.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Notation/Notations/SanNotation.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Notation/Notations/SmithNotation.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Notation/Notations/UciNotation.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Polyglot/IPolyglotBook.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Polyglot/PolyglotBook.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Polyglot/PolyglotBookConfiguration.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Polyglot/PolyglotBookEntry.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Polyglot/PolyglotBookZobrist.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Polyglot/ReverseEndianBinaryStreamReader.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Position.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Protocol/UCI/Clock.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Protocol/UCI/CopyProtections.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Protocol/UCI/Cpu.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Protocol/UCI/HiResTimer.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Protocol/UCI/HiResTimerArgs.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Protocol/UCI/ICpu.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Protocol/UCI/IHiResTimer.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Protocol/UCI/IInputOutput.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Protocol/UCI/IMovesToGoModel.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Protocol/UCI/IOption.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Protocol/UCI/ISearchParameters.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Protocol/UCI/IUci.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Protocol/UCI/InputOutput.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Protocol/UCI/InputOutputAction.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Protocol/UCI/MovesToGoModel.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Protocol/UCI/Option.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Protocol/UCI/OptionComparer.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Protocol/UCI/SearchParameters.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Protocol/UCI/UCIProtocol.html (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Protocol/UCI/Uci.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Protocol/UCI/UciOptionType.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Rudzoft.ChessLib.csproj (85%) rename src/{ => chess-lib}/Rudzoft.ChessLib/State.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Tables/HashTable.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Tables/History/HistoryHeuristic.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Tables/History/IHistoryHeuristic.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Tables/IHashTable.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Tables/ITableEntry.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Tables/KillerMoves/IKillerMoves.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Tables/KillerMoves/KillerMoves.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Tables/Perft/IPerftTableEntry.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Tables/Perft/PerftTable.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/ToDo.md (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/TroubledFens.txt (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Types/BitBoard.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Types/BitBoards.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Types/CastleRight.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Types/Color.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Types/Depth.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Types/Direction.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Types/File.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Types/HashKey.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Types/IPieceSquare.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Types/IValidationType.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Types/MagicBB.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Types/Move.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Types/Piece.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Types/PieceSquare.cs (97%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Types/PieceSquareEventArgs.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Types/PieceType.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Types/Rank.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Types/RootMove.cs (97%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Types/Score.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Types/Square.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Types/StateStack.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Types/ValMove.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Types/Value.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Types/Values.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Validation/IPositionValidator.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Validation/PositionValidationResult.cs (100%) rename src/{ => chess-lib}/Rudzoft.ChessLib/Validation/PositionValidator.cs (100%) rename src/{ => web-api}/Rudzoft.ChessLib.WebApi/.dockerignore (100%) rename src/{ => web-api}/Rudzoft.ChessLib.WebApi/Controllers/MovesController.cs (100%) rename src/{ => web-api}/Rudzoft.ChessLib.WebApi/Controllers/PgnController.cs (100%) rename src/{ => web-api}/Rudzoft.ChessLib.WebApi/Dockerfile (100%) rename src/{ => web-api}/Rudzoft.ChessLib.WebApi/Moves.cs (100%) rename src/{ => web-api}/Rudzoft.ChessLib.WebApi/Program.cs (100%) rename src/{ => web-api}/Rudzoft.ChessLib.WebApi/Properties/launchSettings.json (100%) rename src/{ => web-api}/Rudzoft.ChessLib.WebApi/Queries/MoveQuery.cs (100%) rename src/{ => web-api}/Rudzoft.ChessLib.WebApi/Rudzoft.ChessLib.WebApi.csproj (78%) rename src/{ => web-api}/Rudzoft.ChessLib.WebApi/Services/IMoveGeneratorService.cs (100%) rename src/{ => web-api}/Rudzoft.ChessLib.WebApi/Services/MoveGeneratorService.cs (100%) rename src/{ => web-api}/Rudzoft.ChessLib.WebApi/appsettings.Development.json (100%) rename src/{ => web-api}/Rudzoft.ChessLib.WebApi/appsettings.json (100%) diff --git a/Rudzoft.ChessLib.sln b/Rudzoft.ChessLib.sln index 18405279..64869614 100644 --- a/Rudzoft.ChessLib.sln +++ b/Rudzoft.ChessLib.sln @@ -3,28 +3,12 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.0.32112.339 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Rudzoft.ChessLib", "src\Rudzoft.ChessLib\Rudzoft.ChessLib.csproj", "{44D2509D-D267-4416-92FB-FDE8381A3F46}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Rudzoft.ChessLib.Test", "src\Rudzoft.ChessLib.Test\Rudzoft.ChessLib.Test.csproj", "{45A5E2D9-97E5-49FA-8066-9FEA4609A312}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Rudzoft.ChessLib.Benchmark", "src\Rudzoft.ChessLib.Benchmark\Rudzoft.ChessLib.Benchmark.csproj", "{BF9E9B6E-947E-40E3-956F-AE6A82D5C237}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Rudzoft.ChessLib.Perft", "src\Rudzoft.ChessLib.Perft\Rudzoft.ChessLib.Perft.csproj", "{F253BA49-993B-4119-8226-A6C6DF0B556D}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Rudzoft.ChessLib.Perft.Interfaces", "src\Rudzoft.ChessLib.Perft.Interfaces\Rudzoft.ChessLib.Perft.Interfaces.csproj", "{4AD06BC1-F944-41E8-AAF8-3AA02642E18C}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Rudzoft.ChessLib.WebApi", "src\Rudzoft.ChessLib.WebApi\Rudzoft.ChessLib.WebApi.csproj", "{CFC3DABB-CC74-4B7E-A434-B0F3DD621DE8}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "chess-lib", "chess-lib", "{9F0623CB-4463-40FE-874F-4A18D1871A91}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "perft", "perft", "{96596E23-0DAC-46B7-AEE2-24F55C837AFF}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "web-api", "web-api", "{F82A6A7E-4551-4667-9E0A-57036E1B5117}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Rudzoft.ChessLib.PGN", "src\Rudzoft.ChessLib.PGN\Rudzoft.ChessLib.PGN.csproj", "{07F55E9A-ACF2-4F93-AD03-9E6F41FF78A2}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Rudzoft.ChessLib.PGN.Test", "src\Rudzoft.ChessLib.PGN.Test\Rudzoft.ChessLib.PGN.Test.csproj", "{556ADC0D-074D-4B8F-9E45-1275342FCB74}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{5B4D0B75-CE2C-45E2-92D3-987704C20001}" ProjectSection(SolutionItems) = preProject README.md = README.md @@ -32,50 +16,41 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution global.json = global.json .editorconfig = .editorconfig Directory.Packages.props = Directory.Packages.props + LICENSE = LICENSE + .gitignore = .gitignore + icon\ChessLib.png = icon\ChessLib.png EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Rudzoft.Perft.Domain", "src\perft\Rudzoft.Perft.Domain\Rudzoft.Perft.Domain.csproj", "{374C6338-57B4-44CD-9A40-B13EBC25BCF6}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Rudzoft.Perft", "src\perft\Rudzoft.Perft\Rudzoft.Perft.csproj", "{279378EB-73AF-450C-909C-7145DBE463E0}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "chess-lib.bench", "chess-lib.bench", "{74DC6FDD-D550-4185-9635-1201508E8F22}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "chess-lib.pgn", "chess-lib.pgn", "{CFADCDB7-1278-42ED-A25C-9B3FBB58C520}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Rudzoft.ChessLib", "src\chess-lib\Rudzoft.ChessLib\Rudzoft.ChessLib.csproj", "{CD9A0992-9687-41A1-8C02-DE4063F489DF}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Rudzoft.ChessLib.Test", "src\chess-lib\Rudzoft.ChessLib.Test\Rudzoft.ChessLib.Test.csproj", "{71E13772-CD99-44F7-8F5A-BC7E96300280}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Rudzoft.ChessLib.Perft.Interfaces", "src\chess-lib\Rudzoft.ChessLib.Perft.Interfaces\Rudzoft.ChessLib.Perft.Interfaces.csproj", "{9FFDC3AE-B0B2-403E-AA1E-C1CB04A2F5BE}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Rudzoft.ChessLib.Perft", "src\chess-lib\Rudzoft.ChessLib.Perft\Rudzoft.ChessLib.Perft.csproj", "{D19AFEC7-0EF0-4442-9AB8-2ECFCA2D6246}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Rudzoft.ChessLib.Benchmark", "src\chess-lib.bench\Rudzoft.ChessLib.Benchmark\Rudzoft.ChessLib.Benchmark.csproj", "{18BB06F4-F9B5-4999-8FC5-D5D479FEA82B}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Rudzoft.ChessLib.PGN", "src\chess-lib.pgn\Rudzoft.ChessLib.PGN\Rudzoft.ChessLib.PGN.csproj", "{289BE06C-D071-4620-B7A7-E119F34A40A6}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Rudzoft.ChessLib.PGN.Test", "src\chess-lib.pgn\Rudzoft.ChessLib.PGN.Test\Rudzoft.ChessLib.PGN.Test.csproj", "{BF3D8F4C-743B-4F9F-A227-2763BF8DA2A6}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Rudzoft.ChessLib.WebApi", "src\web-api\Rudzoft.ChessLib.WebApi\Rudzoft.ChessLib.WebApi.csproj", "{F283CA88-BE8D-4A89-8402-357B375877B8}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {44D2509D-D267-4416-92FB-FDE8381A3F46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {44D2509D-D267-4416-92FB-FDE8381A3F46}.Debug|Any CPU.Build.0 = Debug|Any CPU - {44D2509D-D267-4416-92FB-FDE8381A3F46}.Release|Any CPU.ActiveCfg = Release|Any CPU - {44D2509D-D267-4416-92FB-FDE8381A3F46}.Release|Any CPU.Build.0 = Release|Any CPU - {45A5E2D9-97E5-49FA-8066-9FEA4609A312}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {45A5E2D9-97E5-49FA-8066-9FEA4609A312}.Debug|Any CPU.Build.0 = Debug|Any CPU - {45A5E2D9-97E5-49FA-8066-9FEA4609A312}.Release|Any CPU.ActiveCfg = Release|Any CPU - {45A5E2D9-97E5-49FA-8066-9FEA4609A312}.Release|Any CPU.Build.0 = Release|Any CPU - {BF9E9B6E-947E-40E3-956F-AE6A82D5C237}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BF9E9B6E-947E-40E3-956F-AE6A82D5C237}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BF9E9B6E-947E-40E3-956F-AE6A82D5C237}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BF9E9B6E-947E-40E3-956F-AE6A82D5C237}.Release|Any CPU.Build.0 = Release|Any CPU - {F253BA49-993B-4119-8226-A6C6DF0B556D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F253BA49-993B-4119-8226-A6C6DF0B556D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F253BA49-993B-4119-8226-A6C6DF0B556D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F253BA49-993B-4119-8226-A6C6DF0B556D}.Release|Any CPU.Build.0 = Release|Any CPU - {4AD06BC1-F944-41E8-AAF8-3AA02642E18C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4AD06BC1-F944-41E8-AAF8-3AA02642E18C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4AD06BC1-F944-41E8-AAF8-3AA02642E18C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4AD06BC1-F944-41E8-AAF8-3AA02642E18C}.Release|Any CPU.Build.0 = Release|Any CPU - {CFC3DABB-CC74-4B7E-A434-B0F3DD621DE8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CFC3DABB-CC74-4B7E-A434-B0F3DD621DE8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CFC3DABB-CC74-4B7E-A434-B0F3DD621DE8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CFC3DABB-CC74-4B7E-A434-B0F3DD621DE8}.Release|Any CPU.Build.0 = Release|Any CPU - {07F55E9A-ACF2-4F93-AD03-9E6F41FF78A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {07F55E9A-ACF2-4F93-AD03-9E6F41FF78A2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {07F55E9A-ACF2-4F93-AD03-9E6F41FF78A2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {07F55E9A-ACF2-4F93-AD03-9E6F41FF78A2}.Release|Any CPU.Build.0 = Release|Any CPU - {556ADC0D-074D-4B8F-9E45-1275342FCB74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {556ADC0D-074D-4B8F-9E45-1275342FCB74}.Debug|Any CPU.Build.0 = Debug|Any CPU - {556ADC0D-074D-4B8F-9E45-1275342FCB74}.Release|Any CPU.ActiveCfg = Release|Any CPU - {556ADC0D-074D-4B8F-9E45-1275342FCB74}.Release|Any CPU.Build.0 = Release|Any CPU {374C6338-57B4-44CD-9A40-B13EBC25BCF6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {374C6338-57B4-44CD-9A40-B13EBC25BCF6}.Debug|Any CPU.Build.0 = Debug|Any CPU {374C6338-57B4-44CD-9A40-B13EBC25BCF6}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -84,21 +59,53 @@ Global {279378EB-73AF-450C-909C-7145DBE463E0}.Debug|Any CPU.Build.0 = Debug|Any CPU {279378EB-73AF-450C-909C-7145DBE463E0}.Release|Any CPU.ActiveCfg = Release|Any CPU {279378EB-73AF-450C-909C-7145DBE463E0}.Release|Any CPU.Build.0 = Release|Any CPU + {CD9A0992-9687-41A1-8C02-DE4063F489DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CD9A0992-9687-41A1-8C02-DE4063F489DF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CD9A0992-9687-41A1-8C02-DE4063F489DF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CD9A0992-9687-41A1-8C02-DE4063F489DF}.Release|Any CPU.Build.0 = Release|Any CPU + {71E13772-CD99-44F7-8F5A-BC7E96300280}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {71E13772-CD99-44F7-8F5A-BC7E96300280}.Debug|Any CPU.Build.0 = Debug|Any CPU + {71E13772-CD99-44F7-8F5A-BC7E96300280}.Release|Any CPU.ActiveCfg = Release|Any CPU + {71E13772-CD99-44F7-8F5A-BC7E96300280}.Release|Any CPU.Build.0 = Release|Any CPU + {9FFDC3AE-B0B2-403E-AA1E-C1CB04A2F5BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9FFDC3AE-B0B2-403E-AA1E-C1CB04A2F5BE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9FFDC3AE-B0B2-403E-AA1E-C1CB04A2F5BE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9FFDC3AE-B0B2-403E-AA1E-C1CB04A2F5BE}.Release|Any CPU.Build.0 = Release|Any CPU + {D19AFEC7-0EF0-4442-9AB8-2ECFCA2D6246}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D19AFEC7-0EF0-4442-9AB8-2ECFCA2D6246}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D19AFEC7-0EF0-4442-9AB8-2ECFCA2D6246}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D19AFEC7-0EF0-4442-9AB8-2ECFCA2D6246}.Release|Any CPU.Build.0 = Release|Any CPU + {18BB06F4-F9B5-4999-8FC5-D5D479FEA82B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {18BB06F4-F9B5-4999-8FC5-D5D479FEA82B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {18BB06F4-F9B5-4999-8FC5-D5D479FEA82B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {18BB06F4-F9B5-4999-8FC5-D5D479FEA82B}.Release|Any CPU.Build.0 = Release|Any CPU + {289BE06C-D071-4620-B7A7-E119F34A40A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {289BE06C-D071-4620-B7A7-E119F34A40A6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {289BE06C-D071-4620-B7A7-E119F34A40A6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {289BE06C-D071-4620-B7A7-E119F34A40A6}.Release|Any CPU.Build.0 = Release|Any CPU + {BF3D8F4C-743B-4F9F-A227-2763BF8DA2A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BF3D8F4C-743B-4F9F-A227-2763BF8DA2A6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BF3D8F4C-743B-4F9F-A227-2763BF8DA2A6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BF3D8F4C-743B-4F9F-A227-2763BF8DA2A6}.Release|Any CPU.Build.0 = Release|Any CPU + {F283CA88-BE8D-4A89-8402-357B375877B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F283CA88-BE8D-4A89-8402-357B375877B8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F283CA88-BE8D-4A89-8402-357B375877B8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F283CA88-BE8D-4A89-8402-357B375877B8}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution - {44D2509D-D267-4416-92FB-FDE8381A3F46} = {9F0623CB-4463-40FE-874F-4A18D1871A91} - {45A5E2D9-97E5-49FA-8066-9FEA4609A312} = {9F0623CB-4463-40FE-874F-4A18D1871A91} - {BF9E9B6E-947E-40E3-956F-AE6A82D5C237} = {9F0623CB-4463-40FE-874F-4A18D1871A91} - {F253BA49-993B-4119-8226-A6C6DF0B556D} = {9F0623CB-4463-40FE-874F-4A18D1871A91} - {4AD06BC1-F944-41E8-AAF8-3AA02642E18C} = {9F0623CB-4463-40FE-874F-4A18D1871A91} - {CFC3DABB-CC74-4B7E-A434-B0F3DD621DE8} = {F82A6A7E-4551-4667-9E0A-57036E1B5117} - {07F55E9A-ACF2-4F93-AD03-9E6F41FF78A2} = {9F0623CB-4463-40FE-874F-4A18D1871A91} - {556ADC0D-074D-4B8F-9E45-1275342FCB74} = {9F0623CB-4463-40FE-874F-4A18D1871A91} {374C6338-57B4-44CD-9A40-B13EBC25BCF6} = {96596E23-0DAC-46B7-AEE2-24F55C837AFF} {279378EB-73AF-450C-909C-7145DBE463E0} = {96596E23-0DAC-46B7-AEE2-24F55C837AFF} + {CD9A0992-9687-41A1-8C02-DE4063F489DF} = {9F0623CB-4463-40FE-874F-4A18D1871A91} + {71E13772-CD99-44F7-8F5A-BC7E96300280} = {9F0623CB-4463-40FE-874F-4A18D1871A91} + {9FFDC3AE-B0B2-403E-AA1E-C1CB04A2F5BE} = {9F0623CB-4463-40FE-874F-4A18D1871A91} + {D19AFEC7-0EF0-4442-9AB8-2ECFCA2D6246} = {9F0623CB-4463-40FE-874F-4A18D1871A91} + {18BB06F4-F9B5-4999-8FC5-D5D479FEA82B} = {74DC6FDD-D550-4185-9635-1201508E8F22} + {289BE06C-D071-4620-B7A7-E119F34A40A6} = {CFADCDB7-1278-42ED-A25C-9B3FBB58C520} + {BF3D8F4C-743B-4F9F-A227-2763BF8DA2A6} = {CFADCDB7-1278-42ED-A25C-9B3FBB58C520} + {F283CA88-BE8D-4A89-8402-357B375877B8} = {F82A6A7E-4551-4667-9E0A-57036E1B5117} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {0B507B2E-EC45-4DDA-94DD-B7CD5A2B8CF3} diff --git a/src/Rudzoft.ChessLib/Icon/ChessLib.png b/icon/ChessLib.png similarity index 100% rename from src/Rudzoft.ChessLib/Icon/ChessLib.png rename to icon/ChessLib.png diff --git a/src/Rudzoft.ChessLib.Benchmark/BenchBitOp1.txt b/src/chess-lib.bench/Rudzoft.ChessLib.Benchmark/BenchBitOp1.txt similarity index 100% rename from src/Rudzoft.ChessLib.Benchmark/BenchBitOp1.txt rename to src/chess-lib.bench/Rudzoft.ChessLib.Benchmark/BenchBitOp1.txt diff --git a/src/Rudzoft.ChessLib.Benchmark/BitOpBench.cs b/src/chess-lib.bench/Rudzoft.ChessLib.Benchmark/BitOpBench.cs similarity index 100% rename from src/Rudzoft.ChessLib.Benchmark/BitOpBench.cs rename to src/chess-lib.bench/Rudzoft.ChessLib.Benchmark/BitOpBench.cs diff --git a/src/Rudzoft.ChessLib.Benchmark/CharConvertBenchmark.cs b/src/chess-lib.bench/Rudzoft.ChessLib.Benchmark/CharConvertBenchmark.cs similarity index 100% rename from src/Rudzoft.ChessLib.Benchmark/CharConvertBenchmark.cs rename to src/chess-lib.bench/Rudzoft.ChessLib.Benchmark/CharConvertBenchmark.cs diff --git a/src/Rudzoft.ChessLib.Benchmark/FenBenchmark.cs b/src/chess-lib.bench/Rudzoft.ChessLib.Benchmark/FenBenchmark.cs similarity index 100% rename from src/Rudzoft.ChessLib.Benchmark/FenBenchmark.cs rename to src/chess-lib.bench/Rudzoft.ChessLib.Benchmark/FenBenchmark.cs diff --git a/src/Rudzoft.ChessLib.Benchmark/InBetweenBenchmark.cs b/src/chess-lib.bench/Rudzoft.ChessLib.Benchmark/InBetweenBenchmark.cs similarity index 100% rename from src/Rudzoft.ChessLib.Benchmark/InBetweenBenchmark.cs rename to src/chess-lib.bench/Rudzoft.ChessLib.Benchmark/InBetweenBenchmark.cs diff --git a/src/Rudzoft.ChessLib.Benchmark/IsNumericBenchmark.cs b/src/chess-lib.bench/Rudzoft.ChessLib.Benchmark/IsNumericBenchmark.cs similarity index 100% rename from src/Rudzoft.ChessLib.Benchmark/IsNumericBenchmark.cs rename to src/chess-lib.bench/Rudzoft.ChessLib.Benchmark/IsNumericBenchmark.cs diff --git a/src/Rudzoft.ChessLib.Benchmark/IterateBenchmark.cs b/src/chess-lib.bench/Rudzoft.ChessLib.Benchmark/IterateBenchmark.cs similarity index 100% rename from src/Rudzoft.ChessLib.Benchmark/IterateBenchmark.cs rename to src/chess-lib.bench/Rudzoft.ChessLib.Benchmark/IterateBenchmark.cs diff --git a/src/Rudzoft.ChessLib.Benchmark/KeyBenchmarks.cs b/src/chess-lib.bench/Rudzoft.ChessLib.Benchmark/KeyBenchmarks.cs similarity index 100% rename from src/Rudzoft.ChessLib.Benchmark/KeyBenchmarks.cs rename to src/chess-lib.bench/Rudzoft.ChessLib.Benchmark/KeyBenchmarks.cs diff --git a/src/Rudzoft.ChessLib.Benchmark/KnightMoveGenerateBenchmark.cs b/src/chess-lib.bench/Rudzoft.ChessLib.Benchmark/KnightMoveGenerateBenchmark.cs similarity index 100% rename from src/Rudzoft.ChessLib.Benchmark/KnightMoveGenerateBenchmark.cs rename to src/chess-lib.bench/Rudzoft.ChessLib.Benchmark/KnightMoveGenerateBenchmark.cs diff --git a/src/Rudzoft.ChessLib.Benchmark/MagicBBInitBenchmark.cs b/src/chess-lib.bench/Rudzoft.ChessLib.Benchmark/MagicBBInitBenchmark.cs similarity index 100% rename from src/Rudzoft.ChessLib.Benchmark/MagicBBInitBenchmark.cs rename to src/chess-lib.bench/Rudzoft.ChessLib.Benchmark/MagicBBInitBenchmark.cs diff --git a/src/Rudzoft.ChessLib.Benchmark/MoveGeneratorBenchmark.cs b/src/chess-lib.bench/Rudzoft.ChessLib.Benchmark/MoveGeneratorBenchmark.cs similarity index 100% rename from src/Rudzoft.ChessLib.Benchmark/MoveGeneratorBenchmark.cs rename to src/chess-lib.bench/Rudzoft.ChessLib.Benchmark/MoveGeneratorBenchmark.cs diff --git a/src/Rudzoft.ChessLib.Benchmark/MoveGeneratorBenchmarkInfo.md b/src/chess-lib.bench/Rudzoft.ChessLib.Benchmark/MoveGeneratorBenchmarkInfo.md similarity index 100% rename from src/Rudzoft.ChessLib.Benchmark/MoveGeneratorBenchmarkInfo.md rename to src/chess-lib.bench/Rudzoft.ChessLib.Benchmark/MoveGeneratorBenchmarkInfo.md diff --git a/src/Rudzoft.ChessLib.Benchmark/NumberCompactingBenchmark.cs b/src/chess-lib.bench/Rudzoft.ChessLib.Benchmark/NumberCompactingBenchmark.cs similarity index 100% rename from src/Rudzoft.ChessLib.Benchmark/NumberCompactingBenchmark.cs rename to src/chess-lib.bench/Rudzoft.ChessLib.Benchmark/NumberCompactingBenchmark.cs diff --git a/src/Rudzoft.ChessLib.Benchmark/PerftBench.cs b/src/chess-lib.bench/Rudzoft.ChessLib.Benchmark/PerftBench.cs similarity index 100% rename from src/Rudzoft.ChessLib.Benchmark/PerftBench.cs rename to src/chess-lib.bench/Rudzoft.ChessLib.Benchmark/PerftBench.cs diff --git a/src/Rudzoft.ChessLib.Benchmark/Program.cs b/src/chess-lib.bench/Rudzoft.ChessLib.Benchmark/Program.cs similarity index 100% rename from src/Rudzoft.ChessLib.Benchmark/Program.cs rename to src/chess-lib.bench/Rudzoft.ChessLib.Benchmark/Program.cs diff --git a/src/Rudzoft.ChessLib.Benchmark/Rudzoft.ChessLib.Benchmark.csproj b/src/chess-lib.bench/Rudzoft.ChessLib.Benchmark/Rudzoft.ChessLib.Benchmark.csproj similarity index 56% rename from src/Rudzoft.ChessLib.Benchmark/Rudzoft.ChessLib.Benchmark.csproj rename to src/chess-lib.bench/Rudzoft.ChessLib.Benchmark/Rudzoft.ChessLib.Benchmark.csproj index 47411d0d..147d10d7 100644 --- a/src/Rudzoft.ChessLib.Benchmark/Rudzoft.ChessLib.Benchmark.csproj +++ b/src/chess-lib.bench/Rudzoft.ChessLib.Benchmark/Rudzoft.ChessLib.Benchmark.csproj @@ -11,8 +11,10 @@ + + + - diff --git a/src/Rudzoft.ChessLib.Benchmark/ShiftFuncBench.cs b/src/chess-lib.bench/Rudzoft.ChessLib.Benchmark/ShiftFuncBench.cs similarity index 100% rename from src/Rudzoft.ChessLib.Benchmark/ShiftFuncBench.cs rename to src/chess-lib.bench/Rudzoft.ChessLib.Benchmark/ShiftFuncBench.cs diff --git a/src/Rudzoft.ChessLib.Benchmark/SquareIterateBenchmark.cs b/src/chess-lib.bench/Rudzoft.ChessLib.Benchmark/SquareIterateBenchmark.cs similarity index 100% rename from src/Rudzoft.ChessLib.Benchmark/SquareIterateBenchmark.cs rename to src/chess-lib.bench/Rudzoft.ChessLib.Benchmark/SquareIterateBenchmark.cs diff --git a/src/Rudzoft.ChessLib.Benchmark/StringBenchmarks.cs b/src/chess-lib.bench/Rudzoft.ChessLib.Benchmark/StringBenchmarks.cs similarity index 100% rename from src/Rudzoft.ChessLib.Benchmark/StringBenchmarks.cs rename to src/chess-lib.bench/Rudzoft.ChessLib.Benchmark/StringBenchmarks.cs diff --git a/src/Rudzoft.ChessLib.Benchmark/Usings.cs b/src/chess-lib.bench/Rudzoft.ChessLib.Benchmark/Usings.cs similarity index 100% rename from src/Rudzoft.ChessLib.Benchmark/Usings.cs rename to src/chess-lib.bench/Rudzoft.ChessLib.Benchmark/Usings.cs diff --git a/src/Rudzoft.ChessLib.PGN.Test/PgnMoveNotationTests/SanToMoveTests.cs b/src/chess-lib.pgn/Rudzoft.ChessLib.PGN.Test/PgnMoveNotationTests/SanToMoveTests.cs similarity index 100% rename from src/Rudzoft.ChessLib.PGN.Test/PgnMoveNotationTests/SanToMoveTests.cs rename to src/chess-lib.pgn/Rudzoft.ChessLib.PGN.Test/PgnMoveNotationTests/SanToMoveTests.cs diff --git a/src/Rudzoft.ChessLib.PGN.Test/PgnTests/PgnTests.cs b/src/chess-lib.pgn/Rudzoft.ChessLib.PGN.Test/PgnTests/PgnTests.cs similarity index 100% rename from src/Rudzoft.ChessLib.PGN.Test/PgnTests/PgnTests.cs rename to src/chess-lib.pgn/Rudzoft.ChessLib.PGN.Test/PgnTests/PgnTests.cs diff --git a/src/Rudzoft.ChessLib.PGN.Test/Rudzoft.ChessLib.PGN.Test.csproj b/src/chess-lib.pgn/Rudzoft.ChessLib.PGN.Test/Rudzoft.ChessLib.PGN.Test.csproj similarity index 88% rename from src/Rudzoft.ChessLib.PGN.Test/Rudzoft.ChessLib.PGN.Test.csproj rename to src/chess-lib.pgn/Rudzoft.ChessLib.PGN.Test/Rudzoft.ChessLib.PGN.Test.csproj index 43f7b0c1..a953d738 100644 --- a/src/Rudzoft.ChessLib.PGN.Test/Rudzoft.ChessLib.PGN.Test.csproj +++ b/src/chess-lib.pgn/Rudzoft.ChessLib.PGN.Test/Rudzoft.ChessLib.PGN.Test.csproj @@ -14,8 +14,8 @@ + - diff --git a/src/Rudzoft.ChessLib.PGN.Test/Usings.cs b/src/chess-lib.pgn/Rudzoft.ChessLib.PGN.Test/Usings.cs similarity index 100% rename from src/Rudzoft.ChessLib.PGN.Test/Usings.cs rename to src/chess-lib.pgn/Rudzoft.ChessLib.PGN.Test/Usings.cs diff --git a/src/Rudzoft.ChessLib.PGN.Test/samples/sample.pgn b/src/chess-lib.pgn/Rudzoft.ChessLib.PGN.Test/samples/sample.pgn similarity index 100% rename from src/Rudzoft.ChessLib.PGN.Test/samples/sample.pgn rename to src/chess-lib.pgn/Rudzoft.ChessLib.PGN.Test/samples/sample.pgn diff --git a/src/Rudzoft.ChessLib.PGN/IPgnParser.cs b/src/chess-lib.pgn/Rudzoft.ChessLib.PGN/IPgnParser.cs similarity index 100% rename from src/Rudzoft.ChessLib.PGN/IPgnParser.cs rename to src/chess-lib.pgn/Rudzoft.ChessLib.PGN/IPgnParser.cs diff --git a/src/Rudzoft.ChessLib.PGN/NonRegexPgnParser.cs b/src/chess-lib.pgn/Rudzoft.ChessLib.PGN/NonRegexPgnParser.cs similarity index 100% rename from src/Rudzoft.ChessLib.PGN/NonRegexPgnParser.cs rename to src/chess-lib.pgn/Rudzoft.ChessLib.PGN/NonRegexPgnParser.cs diff --git a/src/Rudzoft.ChessLib.PGN/PgnGame.cs b/src/chess-lib.pgn/Rudzoft.ChessLib.PGN/PgnGame.cs similarity index 100% rename from src/Rudzoft.ChessLib.PGN/PgnGame.cs rename to src/chess-lib.pgn/Rudzoft.ChessLib.PGN/PgnGame.cs diff --git a/src/Rudzoft.ChessLib.PGN/PgnGenerator.cs b/src/chess-lib.pgn/Rudzoft.ChessLib.PGN/PgnGenerator.cs similarity index 100% rename from src/Rudzoft.ChessLib.PGN/PgnGenerator.cs rename to src/chess-lib.pgn/Rudzoft.ChessLib.PGN/PgnGenerator.cs diff --git a/src/Rudzoft.ChessLib.PGN/PgnMove.cs b/src/chess-lib.pgn/Rudzoft.ChessLib.PGN/PgnMove.cs similarity index 100% rename from src/Rudzoft.ChessLib.PGN/PgnMove.cs rename to src/chess-lib.pgn/Rudzoft.ChessLib.PGN/PgnMove.cs diff --git a/src/Rudzoft.ChessLib.PGN/PgnParserServiceCollectionExtensions.cs b/src/chess-lib.pgn/Rudzoft.ChessLib.PGN/PgnParserServiceCollectionExtensions.cs similarity index 100% rename from src/Rudzoft.ChessLib.PGN/PgnParserServiceCollectionExtensions.cs rename to src/chess-lib.pgn/Rudzoft.ChessLib.PGN/PgnParserServiceCollectionExtensions.cs diff --git a/src/Rudzoft.ChessLib.PGN/RegexPgnParser.cs b/src/chess-lib.pgn/Rudzoft.ChessLib.PGN/RegexPgnParser.cs similarity index 100% rename from src/Rudzoft.ChessLib.PGN/RegexPgnParser.cs rename to src/chess-lib.pgn/Rudzoft.ChessLib.PGN/RegexPgnParser.cs diff --git a/src/Rudzoft.ChessLib.PGN/Rudzoft.ChessLib.PGN.csproj b/src/chess-lib.pgn/Rudzoft.ChessLib.PGN/Rudzoft.ChessLib.PGN.csproj similarity index 100% rename from src/Rudzoft.ChessLib.PGN/Rudzoft.ChessLib.PGN.csproj rename to src/chess-lib.pgn/Rudzoft.ChessLib.PGN/Rudzoft.ChessLib.PGN.csproj diff --git a/src/Rudzoft.ChessLib.Perft.Interfaces/IPerft.cs b/src/chess-lib/Rudzoft.ChessLib.Perft.Interfaces/IPerft.cs similarity index 100% rename from src/Rudzoft.ChessLib.Perft.Interfaces/IPerft.cs rename to src/chess-lib/Rudzoft.ChessLib.Perft.Interfaces/IPerft.cs diff --git a/src/Rudzoft.ChessLib.Perft.Interfaces/PerftPosition.cs b/src/chess-lib/Rudzoft.ChessLib.Perft.Interfaces/PerftPosition.cs similarity index 100% rename from src/Rudzoft.ChessLib.Perft.Interfaces/PerftPosition.cs rename to src/chess-lib/Rudzoft.ChessLib.Perft.Interfaces/PerftPosition.cs diff --git a/src/Rudzoft.ChessLib.Perft.Interfaces/Rudzoft.ChessLib.Perft.Interfaces.csproj b/src/chess-lib/Rudzoft.ChessLib.Perft.Interfaces/Rudzoft.ChessLib.Perft.Interfaces.csproj similarity index 100% rename from src/Rudzoft.ChessLib.Perft.Interfaces/Rudzoft.ChessLib.Perft.Interfaces.csproj rename to src/chess-lib/Rudzoft.ChessLib.Perft.Interfaces/Rudzoft.ChessLib.Perft.Interfaces.csproj diff --git a/src/Rudzoft.ChessLib.Perft/Perft.cs b/src/chess-lib/Rudzoft.ChessLib.Perft/Perft.cs similarity index 100% rename from src/Rudzoft.ChessLib.Perft/Perft.cs rename to src/chess-lib/Rudzoft.ChessLib.Perft/Perft.cs diff --git a/src/Rudzoft.ChessLib.Perft/PerftPositionFactory.cs b/src/chess-lib/Rudzoft.ChessLib.Perft/PerftPositionFactory.cs similarity index 100% rename from src/Rudzoft.ChessLib.Perft/PerftPositionFactory.cs rename to src/chess-lib/Rudzoft.ChessLib.Perft/PerftPositionFactory.cs diff --git a/src/Rudzoft.ChessLib.Perft/PerftTable.cs b/src/chess-lib/Rudzoft.ChessLib.Perft/PerftTable.cs similarity index 100% rename from src/Rudzoft.ChessLib.Perft/PerftTable.cs rename to src/chess-lib/Rudzoft.ChessLib.Perft/PerftTable.cs diff --git a/src/Rudzoft.ChessLib.Perft/Rudzoft.ChessLib.Perft.csproj b/src/chess-lib/Rudzoft.ChessLib.Perft/Rudzoft.ChessLib.Perft.csproj similarity index 100% rename from src/Rudzoft.ChessLib.Perft/Rudzoft.ChessLib.Perft.csproj rename to src/chess-lib/Rudzoft.ChessLib.Perft/Rudzoft.ChessLib.Perft.csproj diff --git a/src/Rudzoft.ChessLib.Test/BitboardTests/BitboardDataTests.cs b/src/chess-lib/Rudzoft.ChessLib.Test/BitboardTests/BitboardDataTests.cs similarity index 100% rename from src/Rudzoft.ChessLib.Test/BitboardTests/BitboardDataTests.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/BitboardTests/BitboardDataTests.cs diff --git a/src/Rudzoft.ChessLib.Test/BitboardTests/BitboardTests.cs b/src/chess-lib/Rudzoft.ChessLib.Test/BitboardTests/BitboardTests.cs similarity index 100% rename from src/Rudzoft.ChessLib.Test/BitboardTests/BitboardTests.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/BitboardTests/BitboardTests.cs diff --git a/src/Rudzoft.ChessLib.Test/BitboardTests/LineTests.cs b/src/chess-lib/Rudzoft.ChessLib.Test/BitboardTests/LineTests.cs similarity index 100% rename from src/Rudzoft.ChessLib.Test/BitboardTests/LineTests.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/BitboardTests/LineTests.cs diff --git a/src/Rudzoft.ChessLib.Test/BitboardTests/MbbTests.cs b/src/chess-lib/Rudzoft.ChessLib.Test/BitboardTests/MbbTests.cs similarity index 100% rename from src/Rudzoft.ChessLib.Test/BitboardTests/MbbTests.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/BitboardTests/MbbTests.cs diff --git a/src/Rudzoft.ChessLib.Test/BoardTests/BoardTests.cs b/src/chess-lib/Rudzoft.ChessLib.Test/BoardTests/BoardTests.cs similarity index 97% rename from src/Rudzoft.ChessLib.Test/BoardTests/BoardTests.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/BoardTests/BoardTests.cs index 0497d9da..289d80f4 100644 --- a/src/Rudzoft.ChessLib.Test/BoardTests/BoardTests.cs +++ b/src/chess-lib/Rudzoft.ChessLib.Test/BoardTests/BoardTests.cs @@ -1,174 +1,174 @@ -/* -ChessLib, a chess data structure library - -MIT License - -Copyright (c) 2017-2023 Rudy Alex Kohn - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -using System.Diagnostics; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.ObjectPool; -using Rudzoft.ChessLib.Enums; -using Rudzoft.ChessLib.Fen; -using Rudzoft.ChessLib.Hash; -using Rudzoft.ChessLib.MoveGeneration; -using Rudzoft.ChessLib.Types; -using Rudzoft.ChessLib.Validation; - -namespace Rudzoft.ChessLib.Test.BoardTests; - -public sealed class BoardTestsTheoryData : TheoryData -{ - public BoardTestsTheoryData(string[] fens, PieceType[] pts, Color[] players, int[] expectedCounts) - { - Debug.Assert(fens != null); - Debug.Assert(pts != null); - Debug.Assert(players != null); - Debug.Assert(expectedCounts != null); - Debug.Assert(fens.Length == pts.Length); - Debug.Assert(fens.Length == players.Length); - Debug.Assert(fens.Length == expectedCounts.Length); - - var fensSpan = fens.AsSpan(); - var ptsSpan = pts.AsSpan(); - var playersSpan = players.AsSpan(); - var expectedCountSpan = expectedCounts.AsSpan(); - - ref var fenSpace = ref MemoryMarshal.GetReference(fensSpan); - ref var ptsSpace = ref MemoryMarshal.GetReference(ptsSpan); - ref var playersSpace = ref MemoryMarshal.GetReference(playersSpan); - ref var expectedCountSpace = ref MemoryMarshal.GetReference(expectedCountSpan); - - for (var i = 0; i < fens.Length; ++i) - { - var fen = Unsafe.Add(ref fenSpace, i); - var pt = Unsafe.Add(ref ptsSpace, i); - var player = Unsafe.Add(ref playersSpace, i); - var expectedCount = Unsafe.Add(ref expectedCountSpace, i); - Add(fen, pt, player, expectedCount); - } - } -} - -public sealed class BoardTests -{ - private readonly IServiceProvider _serviceProvider; - - public BoardTests() - { - _serviceProvider = new ServiceCollection() - .AddTransient() - .AddSingleton() - .AddSingleton() - .AddSingleton() - .AddSingleton() - .AddSingleton() - .AddTransient() - .AddSingleton() - .AddSingleton(static serviceProvider => - { - var provider = serviceProvider.GetRequiredService(); - var policy = new DefaultPooledObjectPolicy(); - return provider.Create(policy); - }) - .BuildServiceProvider(); - } - - private static readonly string[] Fens = - [ - "rnbqkbnr/1ppQpppp/p2p4/8/8/2P5/PP1PPPPP/RNB1KBNR b KQkq - 1 6", - "rnbqkbnr/1ppQpppp/p2p4/8/8/2P5/PP1PPPPP/RNB1KBNR b KQkq - 1 6", - "rnbqkbnr/1ppQpppp/p2p4/8/8/2P5/PP1PPPPP/RNB1KBNR b KQkq - 1 6", - "rnbqkbnr/1ppQpppp/p2p4/8/8/2P5/PP1PPPPP/RNB1KBNR b KQkq - 1 6", - "rnbqkbnr/1ppQpppp/p2p4/8/8/2P5/PP1PPPPP/RNB1KBNR b KQkq - 1 6", - "rnbqkbnr/1ppQpppp/p2p4/8/8/2P5/PP1PPPPP/RNB1KBNR b KQkq - 1 6", - "rnbqkbnr/1ppQpppp/p2p4/8/8/2P5/PP1PPPPP/RNB1KBNR b KQkq - 1 6", - "rnbqkbnr/1ppQpppp/p2p4/8/8/2P5/PP1PPPPP/RNB1KBNR b KQkq - 1 6", - "rnbqkbnr/1ppQpppp/p2p4/8/8/2P5/PP1PPPPP/RNB1KBNR b KQkq - 1 6", - "rnbqkbnr/1ppQpppp/p2p4/8/8/2P5/PP1PPPPP/RNB1KBNR b KQkq - 1 6", - "rnbqkbnr/1ppQpppp/p2p4/8/8/2P5/PP1PPPPP/RNB1KBNR b KQkq - 1 6", - "rnbqkbnr/1ppQpppp/p2p4/8/8/2P5/PP1PPPPP/RNB1KBNR b KQkq - 1 6", - "5r1k/p6p/4r1n1/3NPp2/8/8/PP4RP/4R1K1 w - - 3 53", - "5r1k/p6p/4r1n1/3NPp2/8/8/PP4RP/4R1K1 w - - 3 53", - "5r1k/p6p/4r1n1/3NPp2/8/8/PP4RP/4R1K1 w - - 3 53", - "5r1k/p6p/4r1n1/3NPp2/8/8/PP4RP/4R1K1 w - - 3 53", - "5r1k/p6p/4r1n1/3NPp2/8/8/PP4RP/4R1K1 w - - 3 53", - "5r1k/p6p/4r1n1/3NPp2/8/8/PP4RP/4R1K1 w - - 3 53", - "5r1k/p6p/4r1n1/3NPp2/8/8/PP4RP/4R1K1 w - - 3 53", - "5r1k/p6p/4r1n1/3NPp2/8/8/PP4RP/4R1K1 w - - 3 53", - "5r1k/p6p/4r1n1/3NPp2/8/8/PP4RP/4R1K1 w - - 3 53", - "5r1k/p6p/4r1n1/3NPp2/8/8/PP4RP/4R1K1 w - - 3 53", - "5r1k/p6p/4r1n1/3NPp2/8/8/PP4RP/4R1K1 w - - 3 53", - "5r1k/p6p/4r1n1/3NPp2/8/8/PP4RP/4R1K1 w - - 3 53" - ]; - - - private static readonly Color[] Player = - [ - Types.Color.White, Types.Color.Black, Types.Color.White, Types.Color.Black, Types.Color.White, - Types.Color.Black, - Types.Color.White, Types.Color.Black, Types.Color.White, Types.Color.Black, Types.Color.White, - Types.Color.Black, - Types.Color.White, Types.Color.Black, Types.Color.White, Types.Color.Black, Types.Color.White, - Types.Color.Black, - Types.Color.White, Types.Color.Black, Types.Color.White, Types.Color.Black, Types.Color.White, - Types.Color.Black - ]; - - private static readonly int[] ExpectedCount = - [ - 8, 8, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, - 4, 3, 1, 1, 0, 0, 2, 2, 0, 0, 1, 1 - ]; - - private static readonly PieceType[] PieceTypes = - [ - PieceType.Pawn, PieceType.Pawn, PieceType.Knight, PieceType.Knight, PieceType.Bishop, PieceType.Bishop, - PieceType.Rook, PieceType.Rook, PieceType.Queen, PieceType.Queen, PieceType.King, PieceType.King, - PieceType.Pawn, PieceType.Pawn, PieceType.Knight, PieceType.Knight, PieceType.Bishop, PieceType.Bishop, - PieceType.Rook, PieceType.Rook, PieceType.Queen, PieceType.Queen, PieceType.King, PieceType.King - ]; - - public static readonly BoardTestsTheoryData TheoryData = new(Fens, PieceTypes, Player, ExpectedCount); - - [Theory] - [MemberData(nameof(TheoryData))] - public void BoardPieceCount(string fen, PieceType pt, Color c, int expected) - { - var pos = _serviceProvider.GetRequiredService(); - - var fenData = new FenData(fen); - var state = new State(); - - pos.Set(in fenData, ChessMode.Normal, in state); - - var board = pos.Board; - - var posCount = pos.Pieces(pt, c).Count; - var boardCount = board.PieceCount(pt, c); - - Assert.Equal(posCount, boardCount); - Assert.Equal(expected, boardCount); - } +/* +ChessLib, a chess data structure library + +MIT License + +Copyright (c) 2017-2023 Rudy Alex Kohn + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +using System.Diagnostics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.ObjectPool; +using Rudzoft.ChessLib.Enums; +using Rudzoft.ChessLib.Fen; +using Rudzoft.ChessLib.Hash; +using Rudzoft.ChessLib.MoveGeneration; +using Rudzoft.ChessLib.Types; +using Rudzoft.ChessLib.Validation; + +namespace Rudzoft.ChessLib.Test.BoardTests; + +public sealed class BoardTestsTheoryData : TheoryData +{ + public BoardTestsTheoryData(string[] fens, PieceType[] pts, Color[] players, int[] expectedCounts) + { + Debug.Assert(fens != null); + Debug.Assert(pts != null); + Debug.Assert(players != null); + Debug.Assert(expectedCounts != null); + Debug.Assert(fens.Length == pts.Length); + Debug.Assert(fens.Length == players.Length); + Debug.Assert(fens.Length == expectedCounts.Length); + + var fensSpan = fens.AsSpan(); + var ptsSpan = pts.AsSpan(); + var playersSpan = players.AsSpan(); + var expectedCountSpan = expectedCounts.AsSpan(); + + ref var fenSpace = ref MemoryMarshal.GetReference(fensSpan); + ref var ptsSpace = ref MemoryMarshal.GetReference(ptsSpan); + ref var playersSpace = ref MemoryMarshal.GetReference(playersSpan); + ref var expectedCountSpace = ref MemoryMarshal.GetReference(expectedCountSpan); + + for (var i = 0; i < fens.Length; ++i) + { + var fen = Unsafe.Add(ref fenSpace, i); + var pt = Unsafe.Add(ref ptsSpace, i); + var player = Unsafe.Add(ref playersSpace, i); + var expectedCount = Unsafe.Add(ref expectedCountSpace, i); + Add(fen, pt, player, expectedCount); + } + } +} + +public sealed class BoardTests +{ + private readonly IServiceProvider _serviceProvider; + + public BoardTests() + { + _serviceProvider = new ServiceCollection() + .AddTransient() + .AddSingleton() + .AddSingleton() + .AddSingleton() + .AddSingleton() + .AddSingleton() + .AddTransient() + .AddSingleton() + .AddSingleton(static serviceProvider => + { + var provider = serviceProvider.GetRequiredService(); + var policy = new DefaultPooledObjectPolicy(); + return provider.Create(policy); + }) + .BuildServiceProvider(); + } + + private static readonly string[] Fens = + [ + "rnbqkbnr/1ppQpppp/p2p4/8/8/2P5/PP1PPPPP/RNB1KBNR b KQkq - 1 6", + "rnbqkbnr/1ppQpppp/p2p4/8/8/2P5/PP1PPPPP/RNB1KBNR b KQkq - 1 6", + "rnbqkbnr/1ppQpppp/p2p4/8/8/2P5/PP1PPPPP/RNB1KBNR b KQkq - 1 6", + "rnbqkbnr/1ppQpppp/p2p4/8/8/2P5/PP1PPPPP/RNB1KBNR b KQkq - 1 6", + "rnbqkbnr/1ppQpppp/p2p4/8/8/2P5/PP1PPPPP/RNB1KBNR b KQkq - 1 6", + "rnbqkbnr/1ppQpppp/p2p4/8/8/2P5/PP1PPPPP/RNB1KBNR b KQkq - 1 6", + "rnbqkbnr/1ppQpppp/p2p4/8/8/2P5/PP1PPPPP/RNB1KBNR b KQkq - 1 6", + "rnbqkbnr/1ppQpppp/p2p4/8/8/2P5/PP1PPPPP/RNB1KBNR b KQkq - 1 6", + "rnbqkbnr/1ppQpppp/p2p4/8/8/2P5/PP1PPPPP/RNB1KBNR b KQkq - 1 6", + "rnbqkbnr/1ppQpppp/p2p4/8/8/2P5/PP1PPPPP/RNB1KBNR b KQkq - 1 6", + "rnbqkbnr/1ppQpppp/p2p4/8/8/2P5/PP1PPPPP/RNB1KBNR b KQkq - 1 6", + "rnbqkbnr/1ppQpppp/p2p4/8/8/2P5/PP1PPPPP/RNB1KBNR b KQkq - 1 6", + "5r1k/p6p/4r1n1/3NPp2/8/8/PP4RP/4R1K1 w - - 3 53", + "5r1k/p6p/4r1n1/3NPp2/8/8/PP4RP/4R1K1 w - - 3 53", + "5r1k/p6p/4r1n1/3NPp2/8/8/PP4RP/4R1K1 w - - 3 53", + "5r1k/p6p/4r1n1/3NPp2/8/8/PP4RP/4R1K1 w - - 3 53", + "5r1k/p6p/4r1n1/3NPp2/8/8/PP4RP/4R1K1 w - - 3 53", + "5r1k/p6p/4r1n1/3NPp2/8/8/PP4RP/4R1K1 w - - 3 53", + "5r1k/p6p/4r1n1/3NPp2/8/8/PP4RP/4R1K1 w - - 3 53", + "5r1k/p6p/4r1n1/3NPp2/8/8/PP4RP/4R1K1 w - - 3 53", + "5r1k/p6p/4r1n1/3NPp2/8/8/PP4RP/4R1K1 w - - 3 53", + "5r1k/p6p/4r1n1/3NPp2/8/8/PP4RP/4R1K1 w - - 3 53", + "5r1k/p6p/4r1n1/3NPp2/8/8/PP4RP/4R1K1 w - - 3 53", + "5r1k/p6p/4r1n1/3NPp2/8/8/PP4RP/4R1K1 w - - 3 53" + ]; + + + private static readonly Color[] Player = + [ + Types.Color.White, Types.Color.Black, Types.Color.White, Types.Color.Black, Types.Color.White, + Types.Color.Black, + Types.Color.White, Types.Color.Black, Types.Color.White, Types.Color.Black, Types.Color.White, + Types.Color.Black, + Types.Color.White, Types.Color.Black, Types.Color.White, Types.Color.Black, Types.Color.White, + Types.Color.Black, + Types.Color.White, Types.Color.Black, Types.Color.White, Types.Color.Black, Types.Color.White, + Types.Color.Black + ]; + + private static readonly int[] ExpectedCount = + [ + 8, 8, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, + 4, 3, 1, 1, 0, 0, 2, 2, 0, 0, 1, 1 + ]; + + private static readonly PieceType[] PieceTypes = + [ + PieceType.Pawn, PieceType.Pawn, PieceType.Knight, PieceType.Knight, PieceType.Bishop, PieceType.Bishop, + PieceType.Rook, PieceType.Rook, PieceType.Queen, PieceType.Queen, PieceType.King, PieceType.King, + PieceType.Pawn, PieceType.Pawn, PieceType.Knight, PieceType.Knight, PieceType.Bishop, PieceType.Bishop, + PieceType.Rook, PieceType.Rook, PieceType.Queen, PieceType.Queen, PieceType.King, PieceType.King + ]; + + public static readonly BoardTestsTheoryData TheoryData = new(Fens, PieceTypes, Player, ExpectedCount); + + [Theory] + [MemberData(nameof(TheoryData))] + public void BoardPieceCount(string fen, PieceType pt, Color c, int expected) + { + var pos = _serviceProvider.GetRequiredService(); + + var fenData = new FenData(fen); + var state = new State(); + + pos.Set(in fenData, ChessMode.Normal, in state); + + var board = pos.Board; + + var posCount = pos.Pieces(pt, c).Count; + var boardCount = board.PieceCount(pt, c); + + Assert.Equal(posCount, boardCount); + Assert.Equal(expected, boardCount); + } } \ No newline at end of file diff --git a/src/Rudzoft.ChessLib.Test/BookTests/BookFixture.cs b/src/chess-lib/Rudzoft.ChessLib.Test/BookTests/BookFixture.cs similarity index 100% rename from src/Rudzoft.ChessLib.Test/BookTests/BookFixture.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/BookTests/BookFixture.cs diff --git a/src/Rudzoft.ChessLib.Test/BookTests/PolyglotTests.cs b/src/chess-lib/Rudzoft.ChessLib.Test/BookTests/PolyglotTests.cs similarity index 100% rename from src/Rudzoft.ChessLib.Test/BookTests/PolyglotTests.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/BookTests/PolyglotTests.cs diff --git a/src/Rudzoft.ChessLib.Test/BookTests/gm2600.bin b/src/chess-lib/Rudzoft.ChessLib.Test/BookTests/gm2600.bin similarity index 100% rename from src/Rudzoft.ChessLib.Test/BookTests/gm2600.bin rename to src/chess-lib/Rudzoft.ChessLib.Test/BookTests/gm2600.bin diff --git a/src/Rudzoft.ChessLib.Test/CastleTests/BasicCastleTests.cs b/src/chess-lib/Rudzoft.ChessLib.Test/CastleTests/BasicCastleTests.cs similarity index 100% rename from src/Rudzoft.ChessLib.Test/CastleTests/BasicCastleTests.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/CastleTests/BasicCastleTests.cs diff --git a/src/Rudzoft.ChessLib.Test/CastleTests/CastleRightTests.cs b/src/chess-lib/Rudzoft.ChessLib.Test/CastleTests/CastleRightTests.cs similarity index 100% rename from src/Rudzoft.ChessLib.Test/CastleTests/CastleRightTests.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/CastleTests/CastleRightTests.cs diff --git a/src/Rudzoft.ChessLib.Test/DataTests/DataTests.cs b/src/chess-lib/Rudzoft.ChessLib.Test/DataTests/DataTests.cs similarity index 100% rename from src/Rudzoft.ChessLib.Test/DataTests/DataTests.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/DataTests/DataTests.cs diff --git a/src/Rudzoft.ChessLib.Test/DataTests/PieceSquareTests.cs b/src/chess-lib/Rudzoft.ChessLib.Test/DataTests/PieceSquareTests.cs similarity index 100% rename from src/Rudzoft.ChessLib.Test/DataTests/PieceSquareTests.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/DataTests/PieceSquareTests.cs diff --git a/src/Rudzoft.ChessLib.Test/DataTests/RecordHashTests.cs b/src/chess-lib/Rudzoft.ChessLib.Test/DataTests/RecordHashTests.cs similarity index 100% rename from src/Rudzoft.ChessLib.Test/DataTests/RecordHashTests.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/DataTests/RecordHashTests.cs diff --git a/src/Rudzoft.ChessLib.Test/DataTests/StringExtensionsTests.cs b/src/chess-lib/Rudzoft.ChessLib.Test/DataTests/StringExtensionsTests.cs similarity index 100% rename from src/Rudzoft.ChessLib.Test/DataTests/StringExtensionsTests.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/DataTests/StringExtensionsTests.cs diff --git a/src/Rudzoft.ChessLib.Test/EvaluationTests/KpkBitBaseTests.cs b/src/chess-lib/Rudzoft.ChessLib.Test/EvaluationTests/KpkBitBaseTests.cs similarity index 100% rename from src/Rudzoft.ChessLib.Test/EvaluationTests/KpkBitBaseTests.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/EvaluationTests/KpkBitBaseTests.cs diff --git a/src/Rudzoft.ChessLib.Test/FENTests/FenTests.cs b/src/chess-lib/Rudzoft.ChessLib.Test/FENTests/FenTests.cs similarity index 100% rename from src/Rudzoft.ChessLib.Test/FENTests/FenTests.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/FENTests/FenTests.cs diff --git a/src/Rudzoft.ChessLib.Test/FenceTests/FenceTests.cs b/src/chess-lib/Rudzoft.ChessLib.Test/FenceTests/FenceTests.cs similarity index 100% rename from src/Rudzoft.ChessLib.Test/FenceTests/FenceTests.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/FenceTests/FenceTests.cs diff --git a/src/Rudzoft.ChessLib.Test/FileTests/FileEdgeDistanceTests.cs b/src/chess-lib/Rudzoft.ChessLib.Test/FileTests/FileEdgeDistanceTests.cs similarity index 100% rename from src/Rudzoft.ChessLib.Test/FileTests/FileEdgeDistanceTests.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/FileTests/FileEdgeDistanceTests.cs diff --git a/src/Rudzoft.ChessLib.Test/FileTests/FileTests.cs b/src/chess-lib/Rudzoft.ChessLib.Test/FileTests/FileTests.cs similarity index 100% rename from src/Rudzoft.ChessLib.Test/FileTests/FileTests.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/FileTests/FileTests.cs diff --git a/src/Rudzoft.ChessLib.Test/GameplayTests/FoolsCheckMateTests.cs b/src/chess-lib/Rudzoft.ChessLib.Test/GameplayTests/FoolsCheckMateTests.cs similarity index 100% rename from src/Rudzoft.ChessLib.Test/GameplayTests/FoolsCheckMateTests.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/GameplayTests/FoolsCheckMateTests.cs diff --git a/src/Rudzoft.ChessLib.Test/MateTests/MateTests.cs b/src/chess-lib/Rudzoft.ChessLib.Test/MateTests/MateTests.cs similarity index 100% rename from src/Rudzoft.ChessLib.Test/MateTests/MateTests.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/MateTests/MateTests.cs diff --git a/src/Rudzoft.ChessLib.Test/MaterialTests/MaterialTests.cs b/src/chess-lib/Rudzoft.ChessLib.Test/MaterialTests/MaterialTests.cs similarity index 100% rename from src/Rudzoft.ChessLib.Test/MaterialTests/MaterialTests.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/MaterialTests/MaterialTests.cs diff --git a/src/Rudzoft.ChessLib.Test/MoveTests/MoveGen_49.cs b/src/chess-lib/Rudzoft.ChessLib.Test/MoveTests/MoveGen_49.cs similarity index 100% rename from src/Rudzoft.ChessLib.Test/MoveTests/MoveGen_49.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/MoveTests/MoveGen_49.cs diff --git a/src/Rudzoft.ChessLib.Test/MoveTests/MoveGeneratorTests.cs b/src/chess-lib/Rudzoft.ChessLib.Test/MoveTests/MoveGeneratorTests.cs similarity index 100% rename from src/Rudzoft.ChessLib.Test/MoveTests/MoveGeneratorTests.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/MoveTests/MoveGeneratorTests.cs diff --git a/src/Rudzoft.ChessLib.Test/MoveTests/MoveTests.cs b/src/chess-lib/Rudzoft.ChessLib.Test/MoveTests/MoveTests.cs similarity index 100% rename from src/Rudzoft.ChessLib.Test/MoveTests/MoveTests.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/MoveTests/MoveTests.cs diff --git a/src/Rudzoft.ChessLib.Test/NotationTests/FanTests.cs b/src/chess-lib/Rudzoft.ChessLib.Test/NotationTests/FanTests.cs similarity index 97% rename from src/Rudzoft.ChessLib.Test/NotationTests/FanTests.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/NotationTests/FanTests.cs index ae0fea53..b9bc3e49 100644 --- a/src/Rudzoft.ChessLib.Test/NotationTests/FanTests.cs +++ b/src/chess-lib/Rudzoft.ChessLib.Test/NotationTests/FanTests.cs @@ -1,136 +1,136 @@ -/* -ChessLib, a chess data structure library - -MIT License - -Copyright (c) 2017-2023 Rudy Alex Kohn - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -using Microsoft.Extensions.DependencyInjection; -using Rudzoft.ChessLib.Enums; -using Rudzoft.ChessLib.Extensions; -using Rudzoft.ChessLib.Fen; -using Rudzoft.ChessLib.Notation; -using Rudzoft.ChessLib.Notation.Notations; -using Rudzoft.ChessLib.Types; - -namespace Rudzoft.ChessLib.Test.NotationTests; - -public sealed class FanTests -{ - private readonly IServiceProvider _serviceProvider = new ServiceCollection() - .AddChessLib() - .BuildServiceProvider(); - - [Theory] - [InlineData("8/6k1/8/8/8/8/1K1N1N2/8 w - - 0 1", MoveNotations.Fan, PieceTypes.Knight, Squares.d2, Squares.f2, - Squares.e4)] - public void FanRankAmbiguities( - string fen, - MoveNotations moveNotation, - PieceTypes movingPt, - Squares fromSqOne, - Squares fromSqTwo, - Squares toSq) - { - var pos = _serviceProvider.GetRequiredService(); - - var fenData = new FenData(fen); - var state = new State(); - - pos.Set(in fenData, ChessMode.Normal, state); - - var pt = new PieceType(movingPt); - var pc = pt.MakePiece(pos.SideToMove); - - var fromOne = new Square(fromSqOne); - var fromTwo = new Square(fromSqTwo); - var to = new Square(toSq); - - Assert.True(fromOne.IsOk); - Assert.True(fromTwo.IsOk); - Assert.True(to.IsOk); - - var pieceChar = pc.GetUnicodeChar(); - var toString = to.ToString(); - - var moveOne = Move.Create(fromOne, to); - var moveTwo = Move.Create(fromTwo, to); - - var notation = _serviceProvider.GetRequiredService(); - - var expectedOne = $"{pieceChar}{fromOne.FileChar}{toString}"; - var expectedTwo = $"{pieceChar}{fromTwo.FileChar}{toString}"; - - var actualOne = notation.ToNotation(moveNotation).Convert(pos, moveOne); - var actualTwo = notation.ToNotation(moveNotation).Convert(pos, moveTwo); - - Assert.Equal(expectedOne, actualOne); - Assert.Equal(expectedTwo, actualTwo); - } - - [Theory] - [InlineData("8/6k1/8/8/3N4/8/1K1N4/8 w - - 0 1", MoveNotations.Fan, PieceTypes.Knight, Squares.d2, Squares.d4, - Squares.f3)] - public void FanFileAmbiguities( - string fen, - MoveNotations moveNotation, - PieceTypes movingPt, - Squares fromSqOne, - Squares fromSqTwo, - Squares toSq) - { - var pos = _serviceProvider.GetRequiredService(); - - var fenData = new FenData(fen); - var state = new State(); - - pos.Set(in fenData, ChessMode.Normal, state); - - var pt = new PieceType(movingPt); - var pc = pt.MakePiece(pos.SideToMove); - - var fromOne = new Square(fromSqOne); - var fromTwo = new Square(fromSqTwo); - var to = new Square(toSq); - - Assert.True(fromOne.IsOk); - Assert.True(fromTwo.IsOk); - Assert.True(to.IsOk); - - var pieceChar = pc.GetUnicodeChar(); - var toString = to.ToString(); - - var moveOne = Move.Create(fromOne, to); - var moveTwo = Move.Create(fromTwo, to); - - var notation = _serviceProvider.GetRequiredService(); - - var expectedOne = $"{pieceChar}{fromOne.RankChar}{toString}"; - var expectedTwo = $"{pieceChar}{fromTwo.RankChar}{toString}"; - - var actualOne = notation.ToNotation(moveNotation).Convert(pos, moveOne); - var actualTwo = notation.ToNotation(moveNotation).Convert(pos, moveTwo); - - Assert.Equal(expectedOne, actualOne); - Assert.Equal(expectedTwo, actualTwo); - } +/* +ChessLib, a chess data structure library + +MIT License + +Copyright (c) 2017-2023 Rudy Alex Kohn + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +using Microsoft.Extensions.DependencyInjection; +using Rudzoft.ChessLib.Enums; +using Rudzoft.ChessLib.Extensions; +using Rudzoft.ChessLib.Fen; +using Rudzoft.ChessLib.Notation; +using Rudzoft.ChessLib.Notation.Notations; +using Rudzoft.ChessLib.Types; + +namespace Rudzoft.ChessLib.Test.NotationTests; + +public sealed class FanTests +{ + private readonly IServiceProvider _serviceProvider = new ServiceCollection() + .AddChessLib() + .BuildServiceProvider(); + + [Theory] + [InlineData("8/6k1/8/8/8/8/1K1N1N2/8 w - - 0 1", MoveNotations.Fan, PieceTypes.Knight, Squares.d2, Squares.f2, + Squares.e4)] + public void FanRankAmbiguities( + string fen, + MoveNotations moveNotation, + PieceTypes movingPt, + Squares fromSqOne, + Squares fromSqTwo, + Squares toSq) + { + var pos = _serviceProvider.GetRequiredService(); + + var fenData = new FenData(fen); + var state = new State(); + + pos.Set(in fenData, ChessMode.Normal, state); + + var pt = new PieceType(movingPt); + var pc = pt.MakePiece(pos.SideToMove); + + var fromOne = new Square(fromSqOne); + var fromTwo = new Square(fromSqTwo); + var to = new Square(toSq); + + Assert.True(fromOne.IsOk); + Assert.True(fromTwo.IsOk); + Assert.True(to.IsOk); + + var pieceChar = pc.GetUnicodeChar(); + var toString = to.ToString(); + + var moveOne = Move.Create(fromOne, to); + var moveTwo = Move.Create(fromTwo, to); + + var notation = _serviceProvider.GetRequiredService(); + + var expectedOne = $"{pieceChar}{fromOne.FileChar}{toString}"; + var expectedTwo = $"{pieceChar}{fromTwo.FileChar}{toString}"; + + var actualOne = notation.ToNotation(moveNotation).Convert(pos, moveOne); + var actualTwo = notation.ToNotation(moveNotation).Convert(pos, moveTwo); + + Assert.Equal(expectedOne, actualOne); + Assert.Equal(expectedTwo, actualTwo); + } + + [Theory] + [InlineData("8/6k1/8/8/3N4/8/1K1N4/8 w - - 0 1", MoveNotations.Fan, PieceTypes.Knight, Squares.d2, Squares.d4, + Squares.f3)] + public void FanFileAmbiguities( + string fen, + MoveNotations moveNotation, + PieceTypes movingPt, + Squares fromSqOne, + Squares fromSqTwo, + Squares toSq) + { + var pos = _serviceProvider.GetRequiredService(); + + var fenData = new FenData(fen); + var state = new State(); + + pos.Set(in fenData, ChessMode.Normal, state); + + var pt = new PieceType(movingPt); + var pc = pt.MakePiece(pos.SideToMove); + + var fromOne = new Square(fromSqOne); + var fromTwo = new Square(fromSqTwo); + var to = new Square(toSq); + + Assert.True(fromOne.IsOk); + Assert.True(fromTwo.IsOk); + Assert.True(to.IsOk); + + var pieceChar = pc.GetUnicodeChar(); + var toString = to.ToString(); + + var moveOne = Move.Create(fromOne, to); + var moveTwo = Move.Create(fromTwo, to); + + var notation = _serviceProvider.GetRequiredService(); + + var expectedOne = $"{pieceChar}{fromOne.RankChar}{toString}"; + var expectedTwo = $"{pieceChar}{fromTwo.RankChar}{toString}"; + + var actualOne = notation.ToNotation(moveNotation).Convert(pos, moveOne); + var actualTwo = notation.ToNotation(moveNotation).Convert(pos, moveTwo); + + Assert.Equal(expectedOne, actualOne); + Assert.Equal(expectedTwo, actualTwo); + } } \ No newline at end of file diff --git a/src/Rudzoft.ChessLib.Test/NotationTests/IccfTests.cs b/src/chess-lib/Rudzoft.ChessLib.Test/NotationTests/IccfTests.cs similarity index 97% rename from src/Rudzoft.ChessLib.Test/NotationTests/IccfTests.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/NotationTests/IccfTests.cs index e312c7b0..ba163946 100644 --- a/src/Rudzoft.ChessLib.Test/NotationTests/IccfTests.cs +++ b/src/chess-lib/Rudzoft.ChessLib.Test/NotationTests/IccfTests.cs @@ -1,92 +1,92 @@ -/* -ChessLib, a chess data structure library - -MIT License - -Copyright (c) 2017-2023 Rudy Alex Kohn - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -using Microsoft.Extensions.DependencyInjection; -using Rudzoft.ChessLib.Enums; -using Rudzoft.ChessLib.Extensions; -using Rudzoft.ChessLib.Fen; -using Rudzoft.ChessLib.Notation; -using Rudzoft.ChessLib.Notation.Notations; -using Rudzoft.ChessLib.Types; - -namespace Rudzoft.ChessLib.Test.NotationTests; - -public sealed class IccfTests -{ - private readonly IServiceProvider _serviceProvider = new ServiceCollection() - .AddChessLib() - .BuildServiceProvider(); - - [Fact] - public void IccfRegularMove() - { - const string fen = "8/6k1/8/8/3N4/8/1K1N4/8 w - - 0 1"; - const MoveNotations moveNotations = MoveNotations.ICCF; - const string expectedPrimary = "4263"; - - var pos = _serviceProvider.GetRequiredService(); - - var fenData = new FenData(fen); - var state = new State(); - - pos.Set(in fenData, ChessMode.Normal, state); - - var w1 = Move.Create(Square.D2, Square.F3); - - var moveNotation = _serviceProvider.GetRequiredService(); - var notation = moveNotation.ToNotation(moveNotations); - - var actualPrimary = notation.Convert(pos, w1); - - Assert.Equal(expectedPrimary, actualPrimary); - } - - [Theory] - [InlineData("8/1P4k1/8/8/8/8/1K6/8 w - - 0 1", PieceTypes.Queen, "27281")] - [InlineData("8/1P4k1/8/8/8/8/1K6/8 w - - 0 1", PieceTypes.Rook, "27282")] - [InlineData("8/1P4k1/8/8/8/8/1K6/8 w - - 0 1", PieceTypes.Bishop, "27283")] - [InlineData("8/1P4k1/8/8/8/8/1K6/8 w - - 0 1", PieceTypes.Knight, "27284")] - public void IccfPromotionMove(string fen, PieceTypes promoPt, string expected) - { - const MoveNotations moveNotations = MoveNotations.ICCF; - - var pos = _serviceProvider.GetRequiredService(); - - var fenData = new FenData(fen); - var state = new State(); - - pos.Set(in fenData, ChessMode.Normal, state); - - var w1 = Move.Create(Squares.b7, Squares.b8, MoveTypes.Promotion, promoPt); - - var moveNotation = _serviceProvider.GetRequiredService(); - var notation = moveNotation.ToNotation(moveNotations); - - var actual = notation.Convert(pos, w1); - - Assert.Equal(expected, actual); - } +/* +ChessLib, a chess data structure library + +MIT License + +Copyright (c) 2017-2023 Rudy Alex Kohn + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +using Microsoft.Extensions.DependencyInjection; +using Rudzoft.ChessLib.Enums; +using Rudzoft.ChessLib.Extensions; +using Rudzoft.ChessLib.Fen; +using Rudzoft.ChessLib.Notation; +using Rudzoft.ChessLib.Notation.Notations; +using Rudzoft.ChessLib.Types; + +namespace Rudzoft.ChessLib.Test.NotationTests; + +public sealed class IccfTests +{ + private readonly IServiceProvider _serviceProvider = new ServiceCollection() + .AddChessLib() + .BuildServiceProvider(); + + [Fact] + public void IccfRegularMove() + { + const string fen = "8/6k1/8/8/3N4/8/1K1N4/8 w - - 0 1"; + const MoveNotations moveNotations = MoveNotations.ICCF; + const string expectedPrimary = "4263"; + + var pos = _serviceProvider.GetRequiredService(); + + var fenData = new FenData(fen); + var state = new State(); + + pos.Set(in fenData, ChessMode.Normal, state); + + var w1 = Move.Create(Square.D2, Square.F3); + + var moveNotation = _serviceProvider.GetRequiredService(); + var notation = moveNotation.ToNotation(moveNotations); + + var actualPrimary = notation.Convert(pos, w1); + + Assert.Equal(expectedPrimary, actualPrimary); + } + + [Theory] + [InlineData("8/1P4k1/8/8/8/8/1K6/8 w - - 0 1", PieceTypes.Queen, "27281")] + [InlineData("8/1P4k1/8/8/8/8/1K6/8 w - - 0 1", PieceTypes.Rook, "27282")] + [InlineData("8/1P4k1/8/8/8/8/1K6/8 w - - 0 1", PieceTypes.Bishop, "27283")] + [InlineData("8/1P4k1/8/8/8/8/1K6/8 w - - 0 1", PieceTypes.Knight, "27284")] + public void IccfPromotionMove(string fen, PieceTypes promoPt, string expected) + { + const MoveNotations moveNotations = MoveNotations.ICCF; + + var pos = _serviceProvider.GetRequiredService(); + + var fenData = new FenData(fen); + var state = new State(); + + pos.Set(in fenData, ChessMode.Normal, state); + + var w1 = Move.Create(Squares.b7, Squares.b8, MoveTypes.Promotion, promoPt); + + var moveNotation = _serviceProvider.GetRequiredService(); + var notation = moveNotation.ToNotation(moveNotations); + + var actual = notation.Convert(pos, w1); + + Assert.Equal(expected, actual); + } } \ No newline at end of file diff --git a/src/Rudzoft.ChessLib.Test/NotationTests/RanTests.cs b/src/chess-lib/Rudzoft.ChessLib.Test/NotationTests/RanTests.cs similarity index 97% rename from src/Rudzoft.ChessLib.Test/NotationTests/RanTests.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/NotationTests/RanTests.cs index 86cab0e3..31aba0f9 100644 --- a/src/Rudzoft.ChessLib.Test/NotationTests/RanTests.cs +++ b/src/chess-lib/Rudzoft.ChessLib.Test/NotationTests/RanTests.cs @@ -1,96 +1,96 @@ -/* -ChessLib, a chess data structure library - -MIT License - -Copyright (c) 2017-2023 Rudy Alex Kohn - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -using Microsoft.Extensions.DependencyInjection; -using Rudzoft.ChessLib.Enums; -using Rudzoft.ChessLib.Extensions; -using Rudzoft.ChessLib.Fen; -using Rudzoft.ChessLib.Notation; -using Rudzoft.ChessLib.Notation.Notations; -using Rudzoft.ChessLib.Types; - -namespace Rudzoft.ChessLib.Test.NotationTests; - -public sealed class RanTests -{ - private readonly IServiceProvider _serviceProvider = new ServiceCollection() - .AddChessLib() - .BuildServiceProvider(); - - [Theory] - [InlineData("8/6k1/8/8/3N4/8/1K1N4/8 w - - 0 1", MoveNotations.Ran, PieceTypes.Knight, Squares.d2, Squares.d4, - Squares.f3)] - [InlineData("8/6k1/8/8/8/8/1K1N1N2/8 w - - 0 1", MoveNotations.Ran, PieceTypes.Knight, Squares.d2, Squares.f2, - Squares.e4)] - [InlineData("8/6k1/8/8/3N4/8/1K1N4/8 w - - 0 1", MoveNotations.Lan, PieceTypes.Knight, Squares.d2, Squares.d4, - Squares.f3)] - [InlineData("8/6k1/8/8/8/8/1K1N1N2/8 w - - 0 1", MoveNotations.Lan, PieceTypes.Knight, Squares.d2, Squares.f2, - Squares.e4)] - public void RanLanAmbiguities( - string fen, - MoveNotations moveNotations, - PieceTypes movingPt, - Squares fromSqOne, - Squares fromSqTwo, - Squares toSq) - { - var pos = _serviceProvider.GetRequiredService(); - - var fenData = new FenData(fen); - var state = new State(); - - pos.Set(in fenData, ChessMode.Normal, state); - - var pt = new PieceType(movingPt); - var pc = pt.MakePiece(pos.SideToMove); - - var fromOne = new Square(fromSqOne); - var fromTwo = new Square(fromSqTwo); - var to = new Square(toSq); - - Assert.True(fromOne.IsOk); - Assert.True(fromTwo.IsOk); - Assert.True(to.IsOk); - - var pieceChar = pc.GetPieceChar(); - var toString = to.ToString(); - - var moveOne = Move.Create(fromOne, to); - var moveTwo = Move.Create(fromTwo, to); - - var moveNotation = _serviceProvider.GetRequiredService(); - var notation = moveNotation.ToNotation(moveNotations); - - var expectedOne = $"{pieceChar}{fromOne}-{toString}"; - var expectedTwo = $"{pieceChar}{fromTwo}-{toString}"; - - var actualOne = notation.Convert(pos, moveOne); - var actualTwo = notation.Convert(pos, moveTwo); - - Assert.Equal(expectedOne, actualOne); - Assert.Equal(expectedTwo, actualTwo); - } +/* +ChessLib, a chess data structure library + +MIT License + +Copyright (c) 2017-2023 Rudy Alex Kohn + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +using Microsoft.Extensions.DependencyInjection; +using Rudzoft.ChessLib.Enums; +using Rudzoft.ChessLib.Extensions; +using Rudzoft.ChessLib.Fen; +using Rudzoft.ChessLib.Notation; +using Rudzoft.ChessLib.Notation.Notations; +using Rudzoft.ChessLib.Types; + +namespace Rudzoft.ChessLib.Test.NotationTests; + +public sealed class RanTests +{ + private readonly IServiceProvider _serviceProvider = new ServiceCollection() + .AddChessLib() + .BuildServiceProvider(); + + [Theory] + [InlineData("8/6k1/8/8/3N4/8/1K1N4/8 w - - 0 1", MoveNotations.Ran, PieceTypes.Knight, Squares.d2, Squares.d4, + Squares.f3)] + [InlineData("8/6k1/8/8/8/8/1K1N1N2/8 w - - 0 1", MoveNotations.Ran, PieceTypes.Knight, Squares.d2, Squares.f2, + Squares.e4)] + [InlineData("8/6k1/8/8/3N4/8/1K1N4/8 w - - 0 1", MoveNotations.Lan, PieceTypes.Knight, Squares.d2, Squares.d4, + Squares.f3)] + [InlineData("8/6k1/8/8/8/8/1K1N1N2/8 w - - 0 1", MoveNotations.Lan, PieceTypes.Knight, Squares.d2, Squares.f2, + Squares.e4)] + public void RanLanAmbiguities( + string fen, + MoveNotations moveNotations, + PieceTypes movingPt, + Squares fromSqOne, + Squares fromSqTwo, + Squares toSq) + { + var pos = _serviceProvider.GetRequiredService(); + + var fenData = new FenData(fen); + var state = new State(); + + pos.Set(in fenData, ChessMode.Normal, state); + + var pt = new PieceType(movingPt); + var pc = pt.MakePiece(pos.SideToMove); + + var fromOne = new Square(fromSqOne); + var fromTwo = new Square(fromSqTwo); + var to = new Square(toSq); + + Assert.True(fromOne.IsOk); + Assert.True(fromTwo.IsOk); + Assert.True(to.IsOk); + + var pieceChar = pc.GetPieceChar(); + var toString = to.ToString(); + + var moveOne = Move.Create(fromOne, to); + var moveTwo = Move.Create(fromTwo, to); + + var moveNotation = _serviceProvider.GetRequiredService(); + var notation = moveNotation.ToNotation(moveNotations); + + var expectedOne = $"{pieceChar}{fromOne}-{toString}"; + var expectedTwo = $"{pieceChar}{fromTwo}-{toString}"; + + var actualOne = notation.Convert(pos, moveOne); + var actualTwo = notation.Convert(pos, moveTwo); + + Assert.Equal(expectedOne, actualOne); + Assert.Equal(expectedTwo, actualTwo); + } } \ No newline at end of file diff --git a/src/Rudzoft.ChessLib.Test/NotationTests/SanTests.cs b/src/chess-lib/Rudzoft.ChessLib.Test/NotationTests/SanTests.cs similarity index 97% rename from src/Rudzoft.ChessLib.Test/NotationTests/SanTests.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/NotationTests/SanTests.cs index 5a8473c3..054bb088 100644 --- a/src/Rudzoft.ChessLib.Test/NotationTests/SanTests.cs +++ b/src/chess-lib/Rudzoft.ChessLib.Test/NotationTests/SanTests.cs @@ -1,219 +1,219 @@ -/* -ChessLib, a chess data structure library - -MIT License - -Copyright (c) 2017-2023 Rudy Alex Kohn - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -using Microsoft.Extensions.DependencyInjection; -using Rudzoft.ChessLib.Enums; -using Rudzoft.ChessLib.Extensions; -using Rudzoft.ChessLib.Fen; -using Rudzoft.ChessLib.MoveGeneration; -using Rudzoft.ChessLib.Notation; -using Rudzoft.ChessLib.Notation.Notations; -using Rudzoft.ChessLib.Types; - -namespace Rudzoft.ChessLib.Test.NotationTests; - -public sealed class SanTests -{ - private readonly IServiceProvider _serviceProvider = new ServiceCollection() - .AddChessLib() - .BuildServiceProvider(); - - [Theory] - [InlineData("8/6k1/8/8/8/8/1K1N1N2/8 w - - 0 1", MoveNotations.San, PieceTypes.Knight, Squares.d2, Squares.f2, - Squares.e4)] - public void SanRankAmbiguities( - string fen, - MoveNotations moveNotations, - PieceTypes movingPt, - Squares fromSqOne, - Squares fromSqTwo, - Squares toSq) - { - var pos = _serviceProvider.GetRequiredService(); - - var fenData = new FenData(fen); - var state = new State(); - - pos.Set(in fenData, ChessMode.Normal, state); - - var pt = new PieceType(movingPt); - var pc = pt.MakePiece(pos.SideToMove); - - var fromOne = new Square(fromSqOne); - var fromTwo = new Square(fromSqTwo); - var to = new Square(toSq); - - Assert.True(fromOne.IsOk); - Assert.True(fromTwo.IsOk); - Assert.True(to.IsOk); - - var pieceChar = pc.GetPieceChar(); - var toString = to.ToString(); - - var moveOne = Move.Create(fromOne, to); - var moveTwo = Move.Create(fromTwo, to); - - var moveNotation = _serviceProvider.GetRequiredService(); - var notation = moveNotation.ToNotation(moveNotations); - - var expectedOne = $"{pieceChar}{fromOne.FileChar}{toString}"; - var expectedTwo = $"{pieceChar}{fromTwo.FileChar}{toString}"; - - var actualOne = notation.Convert(pos, moveOne); - var actualTwo = notation.Convert(pos, moveTwo); - - Assert.Equal(expectedOne, actualOne); - Assert.Equal(expectedTwo, actualTwo); - } - - [Theory] - [InlineData("8/6k1/8/8/3N4/8/1K1N4/8 w - - 0 1", MoveNotations.San, PieceTypes.Knight, Squares.d2, Squares.d4, - Squares.f3)] - public void SanFileAmbiguities( - string fen, MoveNotations moveNotations, PieceTypes movingPt, Squares fromSqOne, - Squares fromSqTwo, Squares toSq) - { - var pos = _serviceProvider.GetRequiredService(); - - var fenData = new FenData(fen); - var state = new State(); - - pos.Set(in fenData, ChessMode.Normal, state); - - var pt = new PieceType(movingPt); - var pc = pt.MakePiece(pos.SideToMove); - - var fromOne = new Square(fromSqOne); - var fromTwo = new Square(fromSqTwo); - var to = new Square(toSq); - - Assert.True(fromOne.IsOk); - Assert.True(fromTwo.IsOk); - Assert.True(to.IsOk); - - var pieceChar = pc.GetPieceChar(); - var toString = to.ToString(); - - var moveOne = Move.Create(fromOne, to); - var moveTwo = Move.Create(fromTwo, to); - - var moveNotation = _serviceProvider.GetRequiredService(); - var notation = moveNotation.ToNotation(moveNotations); - - var expectedOne = $"{pieceChar}{fromOne.RankChar}{toString}"; - var expectedTwo = $"{pieceChar}{fromTwo.RankChar}{toString}"; - - var actualOne = notation.Convert(pos, moveOne); - var actualTwo = notation.Convert(pos, moveTwo); - - Assert.Equal(expectedOne, actualOne); - Assert.Equal(expectedTwo, actualTwo); - } - - [Fact] - public void RookSanAmbiguity() - { - // Tests rook ambiguity notation for white rooks @ e1 and g2. Original author : johnathandavis - - const string fen = "5r1k/p6p/4r1n1/3NPp2/8/8/PP4RP/4R1K1 w - - 3 53"; - const MoveNotations moveNotations = MoveNotations.San; - var expectedNotations = new[] { "Ree2", "Rge2" }; - - var pos = _serviceProvider.GetRequiredService(); - - var fenData = new FenData(fen); - var state = new State(); - - pos.Set(in fenData, ChessMode.Normal, state); - - var sideToMove = pos.SideToMove; - var targetPiece = PieceType.Rook.MakePiece(sideToMove); - - var moveNotation = _serviceProvider.GetRequiredService(); - var notation = moveNotation.ToNotation(moveNotations); - - var ml = pos.GenerateMoves(); - ml.Generate(in pos); - - var sanMoves = ml - .GetMoves(move => pos.GetPiece(move.FromSquare()) == targetPiece) - .Select(m => notation.Convert(pos, m)) - .ToArray(); - - foreach (var notationResult in expectedNotations) - Assert.Contains(sanMoves, s => s == notationResult); - } - - [Theory] - [InlineData("2rr2k1/p3ppbp/b1n3p1/2p1P3/5P2/2N3P1/PP2N1BP/3R1RK1 w - - 2 18", "Rxd8+")] - public void SanCaptureWithCheck(string fen, string expected) - { - // author: skotz - - var pos = _serviceProvider.GetRequiredService(); - - var fenData = new FenData(fen); - var state = new State(); - - pos.Set(in fenData, ChessMode.Normal, state); - - var moveNotation = _serviceProvider.GetRequiredService(); - var notation = moveNotation.ToNotation(MoveNotations.San); - - var move = Move.Create(Square.D1, Square.D8, MoveTypes.Normal); - var sanMove = notation.Convert(pos, move); - - // Capturing a piece with check - Assert.Equal(sanMove, expected); - } - - [Theory] - [InlineData("2rR2k1/p3ppbp/b1n3p1/2p1P3/5P2/2N3P1/PP2N1BP/5RK1 b - - 0 36", "Nxd8", "Rxd8", "Bf8")] - public void SanRecaptureNotCheckmate(string fen, params string[] expected) - { - // author: skotz - - var pos = _serviceProvider.GetRequiredService(); - - var fenData = new FenData(fen); - var state = new State(); - - pos.Set(in fenData, ChessMode.Normal, state); - - var moveNotation = _serviceProvider.GetRequiredService(); - var notation = moveNotation.ToNotation(MoveNotations.San); - - var allMoves = pos.GenerateMoves().Get(); - - foreach (var move in allMoves) - { - var sanMove = notation.Convert(pos, move); - - // Recapturing a piece to remove the check - Assert.Contains(sanMove, expected); - } - } +/* +ChessLib, a chess data structure library + +MIT License + +Copyright (c) 2017-2023 Rudy Alex Kohn + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +using Microsoft.Extensions.DependencyInjection; +using Rudzoft.ChessLib.Enums; +using Rudzoft.ChessLib.Extensions; +using Rudzoft.ChessLib.Fen; +using Rudzoft.ChessLib.MoveGeneration; +using Rudzoft.ChessLib.Notation; +using Rudzoft.ChessLib.Notation.Notations; +using Rudzoft.ChessLib.Types; + +namespace Rudzoft.ChessLib.Test.NotationTests; + +public sealed class SanTests +{ + private readonly IServiceProvider _serviceProvider = new ServiceCollection() + .AddChessLib() + .BuildServiceProvider(); + + [Theory] + [InlineData("8/6k1/8/8/8/8/1K1N1N2/8 w - - 0 1", MoveNotations.San, PieceTypes.Knight, Squares.d2, Squares.f2, + Squares.e4)] + public void SanRankAmbiguities( + string fen, + MoveNotations moveNotations, + PieceTypes movingPt, + Squares fromSqOne, + Squares fromSqTwo, + Squares toSq) + { + var pos = _serviceProvider.GetRequiredService(); + + var fenData = new FenData(fen); + var state = new State(); + + pos.Set(in fenData, ChessMode.Normal, state); + + var pt = new PieceType(movingPt); + var pc = pt.MakePiece(pos.SideToMove); + + var fromOne = new Square(fromSqOne); + var fromTwo = new Square(fromSqTwo); + var to = new Square(toSq); + + Assert.True(fromOne.IsOk); + Assert.True(fromTwo.IsOk); + Assert.True(to.IsOk); + + var pieceChar = pc.GetPieceChar(); + var toString = to.ToString(); + + var moveOne = Move.Create(fromOne, to); + var moveTwo = Move.Create(fromTwo, to); + + var moveNotation = _serviceProvider.GetRequiredService(); + var notation = moveNotation.ToNotation(moveNotations); + + var expectedOne = $"{pieceChar}{fromOne.FileChar}{toString}"; + var expectedTwo = $"{pieceChar}{fromTwo.FileChar}{toString}"; + + var actualOne = notation.Convert(pos, moveOne); + var actualTwo = notation.Convert(pos, moveTwo); + + Assert.Equal(expectedOne, actualOne); + Assert.Equal(expectedTwo, actualTwo); + } + + [Theory] + [InlineData("8/6k1/8/8/3N4/8/1K1N4/8 w - - 0 1", MoveNotations.San, PieceTypes.Knight, Squares.d2, Squares.d4, + Squares.f3)] + public void SanFileAmbiguities( + string fen, MoveNotations moveNotations, PieceTypes movingPt, Squares fromSqOne, + Squares fromSqTwo, Squares toSq) + { + var pos = _serviceProvider.GetRequiredService(); + + var fenData = new FenData(fen); + var state = new State(); + + pos.Set(in fenData, ChessMode.Normal, state); + + var pt = new PieceType(movingPt); + var pc = pt.MakePiece(pos.SideToMove); + + var fromOne = new Square(fromSqOne); + var fromTwo = new Square(fromSqTwo); + var to = new Square(toSq); + + Assert.True(fromOne.IsOk); + Assert.True(fromTwo.IsOk); + Assert.True(to.IsOk); + + var pieceChar = pc.GetPieceChar(); + var toString = to.ToString(); + + var moveOne = Move.Create(fromOne, to); + var moveTwo = Move.Create(fromTwo, to); + + var moveNotation = _serviceProvider.GetRequiredService(); + var notation = moveNotation.ToNotation(moveNotations); + + var expectedOne = $"{pieceChar}{fromOne.RankChar}{toString}"; + var expectedTwo = $"{pieceChar}{fromTwo.RankChar}{toString}"; + + var actualOne = notation.Convert(pos, moveOne); + var actualTwo = notation.Convert(pos, moveTwo); + + Assert.Equal(expectedOne, actualOne); + Assert.Equal(expectedTwo, actualTwo); + } + + [Fact] + public void RookSanAmbiguity() + { + // Tests rook ambiguity notation for white rooks @ e1 and g2. Original author : johnathandavis + + const string fen = "5r1k/p6p/4r1n1/3NPp2/8/8/PP4RP/4R1K1 w - - 3 53"; + const MoveNotations moveNotations = MoveNotations.San; + var expectedNotations = new[] { "Ree2", "Rge2" }; + + var pos = _serviceProvider.GetRequiredService(); + + var fenData = new FenData(fen); + var state = new State(); + + pos.Set(in fenData, ChessMode.Normal, state); + + var sideToMove = pos.SideToMove; + var targetPiece = PieceType.Rook.MakePiece(sideToMove); + + var moveNotation = _serviceProvider.GetRequiredService(); + var notation = moveNotation.ToNotation(moveNotations); + + var ml = pos.GenerateMoves(); + ml.Generate(in pos); + + var sanMoves = ml + .GetMoves(move => pos.GetPiece(move.FromSquare()) == targetPiece) + .Select(m => notation.Convert(pos, m)) + .ToArray(); + + foreach (var notationResult in expectedNotations) + Assert.Contains(sanMoves, s => s == notationResult); + } + + [Theory] + [InlineData("2rr2k1/p3ppbp/b1n3p1/2p1P3/5P2/2N3P1/PP2N1BP/3R1RK1 w - - 2 18", "Rxd8+")] + public void SanCaptureWithCheck(string fen, string expected) + { + // author: skotz + + var pos = _serviceProvider.GetRequiredService(); + + var fenData = new FenData(fen); + var state = new State(); + + pos.Set(in fenData, ChessMode.Normal, state); + + var moveNotation = _serviceProvider.GetRequiredService(); + var notation = moveNotation.ToNotation(MoveNotations.San); + + var move = Move.Create(Square.D1, Square.D8, MoveTypes.Normal); + var sanMove = notation.Convert(pos, move); + + // Capturing a piece with check + Assert.Equal(sanMove, expected); + } + + [Theory] + [InlineData("2rR2k1/p3ppbp/b1n3p1/2p1P3/5P2/2N3P1/PP2N1BP/5RK1 b - - 0 36", "Nxd8", "Rxd8", "Bf8")] + public void SanRecaptureNotCheckmate(string fen, params string[] expected) + { + // author: skotz + + var pos = _serviceProvider.GetRequiredService(); + + var fenData = new FenData(fen); + var state = new State(); + + pos.Set(in fenData, ChessMode.Normal, state); + + var moveNotation = _serviceProvider.GetRequiredService(); + var notation = moveNotation.ToNotation(MoveNotations.San); + + var allMoves = pos.GenerateMoves().Get(); + + foreach (var move in allMoves) + { + var sanMove = notation.Convert(pos, move); + + // Recapturing a piece to remove the check + Assert.Contains(sanMove, expected); + } + } } \ No newline at end of file diff --git a/src/Rudzoft.ChessLib.Test/NumberTests.cs b/src/chess-lib/Rudzoft.ChessLib.Test/NumberTests.cs similarity index 100% rename from src/Rudzoft.ChessLib.Test/NumberTests.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/NumberTests.cs diff --git a/src/Rudzoft.ChessLib.Test/PerftTests/PerftTest.cs b/src/chess-lib/Rudzoft.ChessLib.Test/PerftTests/PerftTest.cs similarity index 100% rename from src/Rudzoft.ChessLib.Test/PerftTests/PerftTest.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/PerftTests/PerftTest.cs diff --git a/src/Rudzoft.ChessLib.Test/PerftTests/PerftTheoryData.cs b/src/chess-lib/Rudzoft.ChessLib.Test/PerftTests/PerftTheoryData.cs similarity index 100% rename from src/Rudzoft.ChessLib.Test/PerftTests/PerftTheoryData.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/PerftTests/PerftTheoryData.cs diff --git a/src/Rudzoft.ChessLib.Test/PerftTests/PerftVerify.cs b/src/chess-lib/Rudzoft.ChessLib.Test/PerftTests/PerftVerify.cs similarity index 100% rename from src/Rudzoft.ChessLib.Test/PerftTests/PerftVerify.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/PerftTests/PerftVerify.cs diff --git a/src/Rudzoft.ChessLib.Test/PiecesTests/PawnDoubleAttackTests.cs b/src/chess-lib/Rudzoft.ChessLib.Test/PiecesTests/PawnDoubleAttackTests.cs similarity index 100% rename from src/Rudzoft.ChessLib.Test/PiecesTests/PawnDoubleAttackTests.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/PiecesTests/PawnDoubleAttackTests.cs diff --git a/src/Rudzoft.ChessLib.Test/PiecesTests/PawnPushTests.cs b/src/chess-lib/Rudzoft.ChessLib.Test/PiecesTests/PawnPushTests.cs similarity index 100% rename from src/Rudzoft.ChessLib.Test/PiecesTests/PawnPushTests.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/PiecesTests/PawnPushTests.cs diff --git a/src/Rudzoft.ChessLib.Test/PiecesTests/PieceAttacks.cs b/src/chess-lib/Rudzoft.ChessLib.Test/PiecesTests/PieceAttacks.cs similarity index 100% rename from src/Rudzoft.ChessLib.Test/PiecesTests/PieceAttacks.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/PiecesTests/PieceAttacks.cs diff --git a/src/Rudzoft.ChessLib.Test/PiecesTests/PieceAttacksBishopTests.cs b/src/chess-lib/Rudzoft.ChessLib.Test/PiecesTests/PieceAttacksBishopTests.cs similarity index 100% rename from src/Rudzoft.ChessLib.Test/PiecesTests/PieceAttacksBishopTests.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/PiecesTests/PieceAttacksBishopTests.cs diff --git a/src/Rudzoft.ChessLib.Test/PiecesTests/PieceAttacksKingTests.cs b/src/chess-lib/Rudzoft.ChessLib.Test/PiecesTests/PieceAttacksKingTests.cs similarity index 100% rename from src/Rudzoft.ChessLib.Test/PiecesTests/PieceAttacksKingTests.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/PiecesTests/PieceAttacksKingTests.cs diff --git a/src/Rudzoft.ChessLib.Test/PiecesTests/PieceAttacksKnightTests.cs b/src/chess-lib/Rudzoft.ChessLib.Test/PiecesTests/PieceAttacksKnightTests.cs similarity index 100% rename from src/Rudzoft.ChessLib.Test/PiecesTests/PieceAttacksKnightTests.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/PiecesTests/PieceAttacksKnightTests.cs diff --git a/src/Rudzoft.ChessLib.Test/PiecesTests/PieceAttacksPawnTests.cs b/src/chess-lib/Rudzoft.ChessLib.Test/PiecesTests/PieceAttacksPawnTests.cs similarity index 100% rename from src/Rudzoft.ChessLib.Test/PiecesTests/PieceAttacksPawnTests.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/PiecesTests/PieceAttacksPawnTests.cs diff --git a/src/Rudzoft.ChessLib.Test/PiecesTests/PieceAttacksRookTests.cs b/src/chess-lib/Rudzoft.ChessLib.Test/PiecesTests/PieceAttacksRookTests.cs similarity index 100% rename from src/Rudzoft.ChessLib.Test/PiecesTests/PieceAttacksRookTests.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/PiecesTests/PieceAttacksRookTests.cs diff --git a/src/Rudzoft.ChessLib.Test/PiecesTests/RegularMobilityFixture.cs b/src/chess-lib/Rudzoft.ChessLib.Test/PiecesTests/RegularMobilityFixture.cs similarity index 100% rename from src/Rudzoft.ChessLib.Test/PiecesTests/RegularMobilityFixture.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/PiecesTests/RegularMobilityFixture.cs diff --git a/src/Rudzoft.ChessLib.Test/PiecesTests/SliderMobilityFixture.cs b/src/chess-lib/Rudzoft.ChessLib.Test/PiecesTests/SliderMobilityFixture.cs similarity index 100% rename from src/Rudzoft.ChessLib.Test/PiecesTests/SliderMobilityFixture.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/PiecesTests/SliderMobilityFixture.cs diff --git a/src/Rudzoft.ChessLib.Test/PiecesTests/SliderMobilityTests.cs b/src/chess-lib/Rudzoft.ChessLib.Test/PiecesTests/SliderMobilityTests.cs similarity index 100% rename from src/Rudzoft.ChessLib.Test/PiecesTests/SliderMobilityTests.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/PiecesTests/SliderMobilityTests.cs diff --git a/src/Rudzoft.ChessLib.Test/PositionTests/EnPassantFenTests.cs b/src/chess-lib/Rudzoft.ChessLib.Test/PositionTests/EnPassantFenTests.cs similarity index 100% rename from src/Rudzoft.ChessLib.Test/PositionTests/EnPassantFenTests.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/PositionTests/EnPassantFenTests.cs diff --git a/src/Rudzoft.ChessLib.Test/PositionTests/PositionTests.cs b/src/chess-lib/Rudzoft.ChessLib.Test/PositionTests/PositionTests.cs similarity index 100% rename from src/Rudzoft.ChessLib.Test/PositionTests/PositionTests.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/PositionTests/PositionTests.cs diff --git a/src/Rudzoft.ChessLib.Test/PositionTests/ValidationTests.cs b/src/chess-lib/Rudzoft.ChessLib.Test/PositionTests/ValidationTests.cs similarity index 100% rename from src/Rudzoft.ChessLib.Test/PositionTests/ValidationTests.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/PositionTests/ValidationTests.cs diff --git a/src/Rudzoft.ChessLib.Test/ProtocolTests/OptionsTests.cs b/src/chess-lib/Rudzoft.ChessLib.Test/ProtocolTests/OptionsTests.cs similarity index 97% rename from src/Rudzoft.ChessLib.Test/ProtocolTests/OptionsTests.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/ProtocolTests/OptionsTests.cs index dcaae4b8..3432abb8 100644 --- a/src/Rudzoft.ChessLib.Test/ProtocolTests/OptionsTests.cs +++ b/src/chess-lib/Rudzoft.ChessLib.Test/ProtocolTests/OptionsTests.cs @@ -1,59 +1,59 @@ -/* -ChessLib, a chess data structure library - -MIT License - -Copyright (c) 2017-2023 Rudy Alex Kohn - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -using Microsoft.Extensions.ObjectPool; -using Rudzoft.ChessLib.MoveGeneration; -using Rudzoft.ChessLib.Protocol.UCI; - -namespace Rudzoft.ChessLib.Test.ProtocolTests; - -public sealed class OptionsTests -{ - [Theory] - [InlineData("Boolean Test", true, true, "option name Boolean Test type Check default true")] - [InlineData("Boolean Test", false, false, "option name Boolean Test type Check default false")] - public void Boolean(string name, bool value, bool expected, string uciString) - { - var provider = new DefaultObjectPoolProvider(); - var policy = new DefaultPooledObjectPolicy(); - - IUci uci = new Uci(provider.Create(policy)); - - uci.Initialize(); - - var option = new Option(name, 0, value); - uci.AddOption(name, option); - - var actual = option.GetBool(); - - Assert.Equal(expected, actual); - Assert.Equal(expected, option); - - var t = uci.ToString(); - - Assert.Contains(uciString, t); - } +/* +ChessLib, a chess data structure library + +MIT License + +Copyright (c) 2017-2023 Rudy Alex Kohn + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +using Microsoft.Extensions.ObjectPool; +using Rudzoft.ChessLib.MoveGeneration; +using Rudzoft.ChessLib.Protocol.UCI; + +namespace Rudzoft.ChessLib.Test.ProtocolTests; + +public sealed class OptionsTests +{ + [Theory] + [InlineData("Boolean Test", true, true, "option name Boolean Test type Check default true")] + [InlineData("Boolean Test", false, false, "option name Boolean Test type Check default false")] + public void Boolean(string name, bool value, bool expected, string uciString) + { + var provider = new DefaultObjectPoolProvider(); + var policy = new DefaultPooledObjectPolicy(); + + IUci uci = new Uci(provider.Create(policy)); + + uci.Initialize(); + + var option = new Option(name, 0, value); + uci.AddOption(name, option); + + var actual = option.GetBool(); + + Assert.Equal(expected, actual); + Assert.Equal(expected, option); + + var t = uci.ToString(); + + Assert.Contains(uciString, t); + } } \ No newline at end of file diff --git a/src/Rudzoft.ChessLib.Test/ProtocolTests/SearchParameterTests.cs b/src/chess-lib/Rudzoft.ChessLib.Test/ProtocolTests/SearchParameterTests.cs similarity index 100% rename from src/Rudzoft.ChessLib.Test/ProtocolTests/SearchParameterTests.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/ProtocolTests/SearchParameterTests.cs diff --git a/src/Rudzoft.ChessLib.Test/ProtocolTests/UciTests.cs b/src/chess-lib/Rudzoft.ChessLib.Test/ProtocolTests/UciTests.cs similarity index 100% rename from src/Rudzoft.ChessLib.Test/ProtocolTests/UciTests.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/ProtocolTests/UciTests.cs diff --git a/src/Rudzoft.ChessLib.Test/RankTests/RankEdgeDistanceTests.cs b/src/chess-lib/Rudzoft.ChessLib.Test/RankTests/RankEdgeDistanceTests.cs similarity index 100% rename from src/Rudzoft.ChessLib.Test/RankTests/RankEdgeDistanceTests.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/RankTests/RankEdgeDistanceTests.cs diff --git a/src/Rudzoft.ChessLib.Test/Rudzoft.ChessLib.Test.csproj b/src/chess-lib/Rudzoft.ChessLib.Test/Rudzoft.ChessLib.Test.csproj similarity index 100% rename from src/Rudzoft.ChessLib.Test/Rudzoft.ChessLib.Test.csproj rename to src/chess-lib/Rudzoft.ChessLib.Test/Rudzoft.ChessLib.Test.csproj diff --git a/src/Rudzoft.ChessLib.Test/ScoreTests/ScoreTests.cs b/src/chess-lib/Rudzoft.ChessLib.Test/ScoreTests/ScoreTests.cs similarity index 100% rename from src/Rudzoft.ChessLib.Test/ScoreTests/ScoreTests.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/ScoreTests/ScoreTests.cs diff --git a/src/Rudzoft.ChessLib.Test/SizesTests/BaseTypesSizeTests.cs b/src/chess-lib/Rudzoft.ChessLib.Test/SizesTests/BaseTypesSizeTests.cs similarity index 100% rename from src/Rudzoft.ChessLib.Test/SizesTests/BaseTypesSizeTests.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/SizesTests/BaseTypesSizeTests.cs diff --git a/src/Rudzoft.ChessLib.Test/SquareTests/DistanceTests.cs b/src/chess-lib/Rudzoft.ChessLib.Test/SquareTests/DistanceTests.cs similarity index 100% rename from src/Rudzoft.ChessLib.Test/SquareTests/DistanceTests.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/SquareTests/DistanceTests.cs diff --git a/src/Rudzoft.ChessLib.Test/SquareTests/SquareFromStringTests.cs b/src/chess-lib/Rudzoft.ChessLib.Test/SquareTests/SquareFromStringTests.cs similarity index 100% rename from src/Rudzoft.ChessLib.Test/SquareTests/SquareFromStringTests.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/SquareTests/SquareFromStringTests.cs diff --git a/src/Rudzoft.ChessLib.Test/SquareTests/SquareRangeTests.cs b/src/chess-lib/Rudzoft.ChessLib.Test/SquareTests/SquareRangeTests.cs similarity index 100% rename from src/Rudzoft.ChessLib.Test/SquareTests/SquareRangeTests.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/SquareTests/SquareRangeTests.cs diff --git a/src/Rudzoft.ChessLib.Test/SquareTests/SquareTests.cs b/src/chess-lib/Rudzoft.ChessLib.Test/SquareTests/SquareTests.cs similarity index 100% rename from src/Rudzoft.ChessLib.Test/SquareTests/SquareTests.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/SquareTests/SquareTests.cs diff --git a/src/Rudzoft.ChessLib.Test/TablesTests/KillerMovesTests.cs b/src/chess-lib/Rudzoft.ChessLib.Test/TablesTests/KillerMovesTests.cs similarity index 100% rename from src/Rudzoft.ChessLib.Test/TablesTests/KillerMovesTests.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/TablesTests/KillerMovesTests.cs diff --git a/src/Rudzoft.ChessLib.Test/Usings.cs b/src/chess-lib/Rudzoft.ChessLib.Test/Usings.cs similarity index 100% rename from src/Rudzoft.ChessLib.Test/Usings.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/Usings.cs diff --git a/src/Rudzoft.ChessLib.Test/ZobristTests/ZobristHashTests.cs b/src/chess-lib/Rudzoft.ChessLib.Test/ZobristTests/ZobristHashTests.cs similarity index 100% rename from src/Rudzoft.ChessLib.Test/ZobristTests/ZobristHashTests.cs rename to src/chess-lib/Rudzoft.ChessLib.Test/ZobristTests/ZobristHashTests.cs diff --git a/src/Rudzoft.ChessLib.Test/xunit.runner.json b/src/chess-lib/Rudzoft.ChessLib.Test/xunit.runner.json similarity index 100% rename from src/Rudzoft.ChessLib.Test/xunit.runner.json rename to src/chess-lib/Rudzoft.ChessLib.Test/xunit.runner.json diff --git a/src/Rudzoft.ChessLib/Blockage.cs b/src/chess-lib/Rudzoft.ChessLib/Blockage.cs similarity index 100% rename from src/Rudzoft.ChessLib/Blockage.cs rename to src/chess-lib/Rudzoft.ChessLib/Blockage.cs diff --git a/src/Rudzoft.ChessLib/Board.cs b/src/chess-lib/Rudzoft.ChessLib/Board.cs similarity index 100% rename from src/Rudzoft.ChessLib/Board.cs rename to src/chess-lib/Rudzoft.ChessLib/Board.cs diff --git a/src/Rudzoft.ChessLib/Cuckoo.cs b/src/chess-lib/Rudzoft.ChessLib/Cuckoo.cs similarity index 100% rename from src/Rudzoft.ChessLib/Cuckoo.cs rename to src/chess-lib/Rudzoft.ChessLib/Cuckoo.cs diff --git a/src/Rudzoft.ChessLib/Enums/ChessMode.cs b/src/chess-lib/Rudzoft.ChessLib/Enums/ChessMode.cs similarity index 100% rename from src/Rudzoft.ChessLib/Enums/ChessMode.cs rename to src/chess-lib/Rudzoft.ChessLib/Enums/ChessMode.cs diff --git a/src/Rudzoft.ChessLib/Enums/GameEndTypes.cs b/src/chess-lib/Rudzoft.ChessLib/Enums/GameEndTypes.cs similarity index 100% rename from src/Rudzoft.ChessLib/Enums/GameEndTypes.cs rename to src/chess-lib/Rudzoft.ChessLib/Enums/GameEndTypes.cs diff --git a/src/Rudzoft.ChessLib/Enums/GameResults.cs b/src/chess-lib/Rudzoft.ChessLib/Enums/GameResults.cs similarity index 100% rename from src/Rudzoft.ChessLib/Enums/GameResults.cs rename to src/chess-lib/Rudzoft.ChessLib/Enums/GameResults.cs diff --git a/src/Rudzoft.ChessLib/Enums/MoveAmbiguities.cs b/src/chess-lib/Rudzoft.ChessLib/Enums/MoveAmbiguities.cs similarity index 100% rename from src/Rudzoft.ChessLib/Enums/MoveAmbiguities.cs rename to src/chess-lib/Rudzoft.ChessLib/Enums/MoveAmbiguities.cs diff --git a/src/Rudzoft.ChessLib/Enums/MoveGenerationTypes.cs b/src/chess-lib/Rudzoft.ChessLib/Enums/MoveGenerationTypes.cs similarity index 100% rename from src/Rudzoft.ChessLib/Enums/MoveGenerationTypes.cs rename to src/chess-lib/Rudzoft.ChessLib/Enums/MoveGenerationTypes.cs diff --git a/src/Rudzoft.ChessLib/Enums/Phases.cs b/src/chess-lib/Rudzoft.ChessLib/Enums/Phases.cs similarity index 100% rename from src/Rudzoft.ChessLib/Enums/Phases.cs rename to src/chess-lib/Rudzoft.ChessLib/Enums/Phases.cs diff --git a/src/Rudzoft.ChessLib/Evaluation/IKpkBitBase.cs b/src/chess-lib/Rudzoft.ChessLib/Evaluation/IKpkBitBase.cs similarity index 100% rename from src/Rudzoft.ChessLib/Evaluation/IKpkBitBase.cs rename to src/chess-lib/Rudzoft.ChessLib/Evaluation/IKpkBitBase.cs diff --git a/src/Rudzoft.ChessLib/Evaluation/KpkBitBase.cs b/src/chess-lib/Rudzoft.ChessLib/Evaluation/KpkBitBase.cs similarity index 100% rename from src/Rudzoft.ChessLib/Evaluation/KpkBitBase.cs rename to src/chess-lib/Rudzoft.ChessLib/Evaluation/KpkBitBase.cs diff --git a/src/Rudzoft.ChessLib/Exceptions/InvalidFenException.cs b/src/chess-lib/Rudzoft.ChessLib/Exceptions/InvalidFenException.cs similarity index 100% rename from src/Rudzoft.ChessLib/Exceptions/InvalidFenException.cs rename to src/chess-lib/Rudzoft.ChessLib/Exceptions/InvalidFenException.cs diff --git a/src/Rudzoft.ChessLib/Exceptions/InvalidMove.cs b/src/chess-lib/Rudzoft.ChessLib/Exceptions/InvalidMove.cs similarity index 100% rename from src/Rudzoft.ChessLib/Exceptions/InvalidMove.cs rename to src/chess-lib/Rudzoft.ChessLib/Exceptions/InvalidMove.cs diff --git a/src/Rudzoft.ChessLib/Exceptions/InvalidSquare.cs b/src/chess-lib/Rudzoft.ChessLib/Exceptions/InvalidSquare.cs similarity index 100% rename from src/Rudzoft.ChessLib/Exceptions/InvalidSquare.cs rename to src/chess-lib/Rudzoft.ChessLib/Exceptions/InvalidSquare.cs diff --git a/src/Rudzoft.ChessLib/Exceptions/TranspositionTableFailure.cs b/src/chess-lib/Rudzoft.ChessLib/Exceptions/TranspositionTableFailure.cs similarity index 100% rename from src/Rudzoft.ChessLib/Exceptions/TranspositionTableFailure.cs rename to src/chess-lib/Rudzoft.ChessLib/Exceptions/TranspositionTableFailure.cs diff --git a/src/Rudzoft.ChessLib/Extensions/ArrayExtensions.cs b/src/chess-lib/Rudzoft.ChessLib/Extensions/ArrayExtensions.cs similarity index 100% rename from src/Rudzoft.ChessLib/Extensions/ArrayExtensions.cs rename to src/chess-lib/Rudzoft.ChessLib/Extensions/ArrayExtensions.cs diff --git a/src/Rudzoft.ChessLib/Extensions/ChessLibServiceCollectionExtensions.cs b/src/chess-lib/Rudzoft.ChessLib/Extensions/ChessLibServiceCollectionExtensions.cs similarity index 100% rename from src/Rudzoft.ChessLib/Extensions/ChessLibServiceCollectionExtensions.cs rename to src/chess-lib/Rudzoft.ChessLib/Extensions/ChessLibServiceCollectionExtensions.cs diff --git a/src/Rudzoft.ChessLib/Extensions/MathExtensions.cs b/src/chess-lib/Rudzoft.ChessLib/Extensions/MathExtensions.cs similarity index 100% rename from src/Rudzoft.ChessLib/Extensions/MathExtensions.cs rename to src/chess-lib/Rudzoft.ChessLib/Extensions/MathExtensions.cs diff --git a/src/Rudzoft.ChessLib/Extensions/Maths.cs b/src/chess-lib/Rudzoft.ChessLib/Extensions/Maths.cs similarity index 100% rename from src/Rudzoft.ChessLib/Extensions/Maths.cs rename to src/chess-lib/Rudzoft.ChessLib/Extensions/Maths.cs diff --git a/src/Rudzoft.ChessLib/Extensions/PieceExtensions.cs b/src/chess-lib/Rudzoft.ChessLib/Extensions/PieceExtensions.cs similarity index 100% rename from src/Rudzoft.ChessLib/Extensions/PieceExtensions.cs rename to src/chess-lib/Rudzoft.ChessLib/Extensions/PieceExtensions.cs diff --git a/src/Rudzoft.ChessLib/Extensions/SpanExtensions.cs b/src/chess-lib/Rudzoft.ChessLib/Extensions/SpanExtensions.cs similarity index 100% rename from src/Rudzoft.ChessLib/Extensions/SpanExtensions.cs rename to src/chess-lib/Rudzoft.ChessLib/Extensions/SpanExtensions.cs diff --git a/src/Rudzoft.ChessLib/Extensions/StringExtensions.cs b/src/chess-lib/Rudzoft.ChessLib/Extensions/StringExtensions.cs similarity index 100% rename from src/Rudzoft.ChessLib/Extensions/StringExtensions.cs rename to src/chess-lib/Rudzoft.ChessLib/Extensions/StringExtensions.cs diff --git a/src/Rudzoft.ChessLib/Factories/IKillerMovesFactory.cs b/src/chess-lib/Rudzoft.ChessLib/Factories/IKillerMovesFactory.cs similarity index 100% rename from src/Rudzoft.ChessLib/Factories/IKillerMovesFactory.cs rename to src/chess-lib/Rudzoft.ChessLib/Factories/IKillerMovesFactory.cs diff --git a/src/Rudzoft.ChessLib/Factories/IPolyglotBookFactory.cs b/src/chess-lib/Rudzoft.ChessLib/Factories/IPolyglotBookFactory.cs similarity index 100% rename from src/Rudzoft.ChessLib/Factories/IPolyglotBookFactory.cs rename to src/chess-lib/Rudzoft.ChessLib/Factories/IPolyglotBookFactory.cs diff --git a/src/Rudzoft.ChessLib/Factories/IServiceFactory.cs b/src/chess-lib/Rudzoft.ChessLib/Factories/IServiceFactory.cs similarity index 100% rename from src/Rudzoft.ChessLib/Factories/IServiceFactory.cs rename to src/chess-lib/Rudzoft.ChessLib/Factories/IServiceFactory.cs diff --git a/src/Rudzoft.ChessLib/Factories/KillerMovesFactory.cs b/src/chess-lib/Rudzoft.ChessLib/Factories/KillerMovesFactory.cs similarity index 100% rename from src/Rudzoft.ChessLib/Factories/KillerMovesFactory.cs rename to src/chess-lib/Rudzoft.ChessLib/Factories/KillerMovesFactory.cs diff --git a/src/Rudzoft.ChessLib/Factories/PolyglotBookFactory.cs b/src/chess-lib/Rudzoft.ChessLib/Factories/PolyglotBookFactory.cs similarity index 100% rename from src/Rudzoft.ChessLib/Factories/PolyglotBookFactory.cs rename to src/chess-lib/Rudzoft.ChessLib/Factories/PolyglotBookFactory.cs diff --git a/src/Rudzoft.ChessLib/Factories/ServiceFactory.cs b/src/chess-lib/Rudzoft.ChessLib/Factories/ServiceFactory.cs similarity index 100% rename from src/Rudzoft.ChessLib/Factories/ServiceFactory.cs rename to src/chess-lib/Rudzoft.ChessLib/Factories/ServiceFactory.cs diff --git a/src/Rudzoft.ChessLib/Fen/Fen.cs b/src/chess-lib/Rudzoft.ChessLib/Fen/Fen.cs similarity index 100% rename from src/Rudzoft.ChessLib/Fen/Fen.cs rename to src/chess-lib/Rudzoft.ChessLib/Fen/Fen.cs diff --git a/src/Rudzoft.ChessLib/Fen/FenData.cs b/src/chess-lib/Rudzoft.ChessLib/Fen/FenData.cs similarity index 100% rename from src/Rudzoft.ChessLib/Fen/FenData.cs rename to src/chess-lib/Rudzoft.ChessLib/Fen/FenData.cs diff --git a/src/Rudzoft.ChessLib/Fen/IFenData.cs b/src/chess-lib/Rudzoft.ChessLib/Fen/IFenData.cs similarity index 100% rename from src/Rudzoft.ChessLib/Fen/IFenData.cs rename to src/chess-lib/Rudzoft.ChessLib/Fen/IFenData.cs diff --git a/src/Rudzoft.ChessLib/Game.cs b/src/chess-lib/Rudzoft.ChessLib/Game.cs similarity index 100% rename from src/Rudzoft.ChessLib/Game.cs rename to src/chess-lib/Rudzoft.ChessLib/Game.cs diff --git a/src/Rudzoft.ChessLib/GlobalSuppressions.cs b/src/chess-lib/Rudzoft.ChessLib/GlobalSuppressions.cs similarity index 100% rename from src/Rudzoft.ChessLib/GlobalSuppressions.cs rename to src/chess-lib/Rudzoft.ChessLib/GlobalSuppressions.cs diff --git a/src/Rudzoft.ChessLib/Hash/IRKiss.cs b/src/chess-lib/Rudzoft.ChessLib/Hash/IRKiss.cs similarity index 100% rename from src/Rudzoft.ChessLib/Hash/IRKiss.cs rename to src/chess-lib/Rudzoft.ChessLib/Hash/IRKiss.cs diff --git a/src/Rudzoft.ChessLib/Hash/IZobrist.cs b/src/chess-lib/Rudzoft.ChessLib/Hash/IZobrist.cs similarity index 100% rename from src/Rudzoft.ChessLib/Hash/IZobrist.cs rename to src/chess-lib/Rudzoft.ChessLib/Hash/IZobrist.cs diff --git a/src/Rudzoft.ChessLib/Hash/RKiss.cs b/src/chess-lib/Rudzoft.ChessLib/Hash/RKiss.cs similarity index 100% rename from src/Rudzoft.ChessLib/Hash/RKiss.cs rename to src/chess-lib/Rudzoft.ChessLib/Hash/RKiss.cs diff --git a/src/Rudzoft.ChessLib/Hash/Tables/Transposition/Bound.cs b/src/chess-lib/Rudzoft.ChessLib/Hash/Tables/Transposition/Bound.cs similarity index 100% rename from src/Rudzoft.ChessLib/Hash/Tables/Transposition/Bound.cs rename to src/chess-lib/Rudzoft.ChessLib/Hash/Tables/Transposition/Bound.cs diff --git a/src/Rudzoft.ChessLib/Hash/Tables/Transposition/ITranspositionTable.cs b/src/chess-lib/Rudzoft.ChessLib/Hash/Tables/Transposition/ITranspositionTable.cs similarity index 100% rename from src/Rudzoft.ChessLib/Hash/Tables/Transposition/ITranspositionTable.cs rename to src/chess-lib/Rudzoft.ChessLib/Hash/Tables/Transposition/ITranspositionTable.cs diff --git a/src/Rudzoft.ChessLib/Hash/Tables/Transposition/PertT.cs b/src/chess-lib/Rudzoft.ChessLib/Hash/Tables/Transposition/PertT.cs similarity index 100% rename from src/Rudzoft.ChessLib/Hash/Tables/Transposition/PertT.cs rename to src/chess-lib/Rudzoft.ChessLib/Hash/Tables/Transposition/PertT.cs diff --git a/src/Rudzoft.ChessLib/Hash/Tables/Transposition/TranspositionTable.cs b/src/chess-lib/Rudzoft.ChessLib/Hash/Tables/Transposition/TranspositionTable.cs similarity index 100% rename from src/Rudzoft.ChessLib/Hash/Tables/Transposition/TranspositionTable.cs rename to src/chess-lib/Rudzoft.ChessLib/Hash/Tables/Transposition/TranspositionTable.cs diff --git a/src/Rudzoft.ChessLib/Hash/Tables/Transposition/TranspositionTableConfiguration.cs b/src/chess-lib/Rudzoft.ChessLib/Hash/Tables/Transposition/TranspositionTableConfiguration.cs similarity index 100% rename from src/Rudzoft.ChessLib/Hash/Tables/Transposition/TranspositionTableConfiguration.cs rename to src/chess-lib/Rudzoft.ChessLib/Hash/Tables/Transposition/TranspositionTableConfiguration.cs diff --git a/src/Rudzoft.ChessLib/Hash/Tables/Transposition/TranspositionTableEntry.cs b/src/chess-lib/Rudzoft.ChessLib/Hash/Tables/Transposition/TranspositionTableEntry.cs similarity index 100% rename from src/Rudzoft.ChessLib/Hash/Tables/Transposition/TranspositionTableEntry.cs rename to src/chess-lib/Rudzoft.ChessLib/Hash/Tables/Transposition/TranspositionTableEntry.cs diff --git a/src/Rudzoft.ChessLib/Hash/Zobrist.cs b/src/chess-lib/Rudzoft.ChessLib/Hash/Zobrist.cs similarity index 100% rename from src/Rudzoft.ChessLib/Hash/Zobrist.cs rename to src/chess-lib/Rudzoft.ChessLib/Hash/Zobrist.cs diff --git a/src/Rudzoft.ChessLib/IBlockage.cs b/src/chess-lib/Rudzoft.ChessLib/IBlockage.cs similarity index 100% rename from src/Rudzoft.ChessLib/IBlockage.cs rename to src/chess-lib/Rudzoft.ChessLib/IBlockage.cs diff --git a/src/Rudzoft.ChessLib/IBoard.cs b/src/chess-lib/Rudzoft.ChessLib/IBoard.cs similarity index 100% rename from src/Rudzoft.ChessLib/IBoard.cs rename to src/chess-lib/Rudzoft.ChessLib/IBoard.cs diff --git a/src/Rudzoft.ChessLib/ICuckoo.cs b/src/chess-lib/Rudzoft.ChessLib/ICuckoo.cs similarity index 100% rename from src/Rudzoft.ChessLib/ICuckoo.cs rename to src/chess-lib/Rudzoft.ChessLib/ICuckoo.cs diff --git a/src/Rudzoft.ChessLib/IGame.cs b/src/chess-lib/Rudzoft.ChessLib/IGame.cs similarity index 100% rename from src/Rudzoft.ChessLib/IGame.cs rename to src/chess-lib/Rudzoft.ChessLib/IGame.cs diff --git a/src/Rudzoft.ChessLib/IPosition.cs b/src/chess-lib/Rudzoft.ChessLib/IPosition.cs similarity index 100% rename from src/Rudzoft.ChessLib/IPosition.cs rename to src/chess-lib/Rudzoft.ChessLib/IPosition.cs diff --git a/src/Rudzoft.ChessLib/IValues.cs b/src/chess-lib/Rudzoft.ChessLib/IValues.cs similarity index 100% rename from src/Rudzoft.ChessLib/IValues.cs rename to src/chess-lib/Rudzoft.ChessLib/IValues.cs diff --git a/src/Rudzoft.ChessLib/MoveGeneration/MoveFactory.cs b/src/chess-lib/Rudzoft.ChessLib/MoveGeneration/MoveFactory.cs similarity index 100% rename from src/Rudzoft.ChessLib/MoveGeneration/MoveFactory.cs rename to src/chess-lib/Rudzoft.ChessLib/MoveGeneration/MoveFactory.cs diff --git a/src/Rudzoft.ChessLib/MoveGeneration/MoveGenerator.cs b/src/chess-lib/Rudzoft.ChessLib/MoveGeneration/MoveGenerator.cs similarity index 100% rename from src/Rudzoft.ChessLib/MoveGeneration/MoveGenerator.cs rename to src/chess-lib/Rudzoft.ChessLib/MoveGeneration/MoveGenerator.cs diff --git a/src/Rudzoft.ChessLib/MoveGeneration/MoveList.cs b/src/chess-lib/Rudzoft.ChessLib/MoveGeneration/MoveList.cs similarity index 100% rename from src/Rudzoft.ChessLib/MoveGeneration/MoveList.cs rename to src/chess-lib/Rudzoft.ChessLib/MoveGeneration/MoveList.cs diff --git a/src/Rudzoft.ChessLib/Notation/IMoveNotation.cs b/src/chess-lib/Rudzoft.ChessLib/Notation/IMoveNotation.cs similarity index 100% rename from src/Rudzoft.ChessLib/Notation/IMoveNotation.cs rename to src/chess-lib/Rudzoft.ChessLib/Notation/IMoveNotation.cs diff --git a/src/Rudzoft.ChessLib/Notation/INotationToMove.cs b/src/chess-lib/Rudzoft.ChessLib/Notation/INotationToMove.cs similarity index 100% rename from src/Rudzoft.ChessLib/Notation/INotationToMove.cs rename to src/chess-lib/Rudzoft.ChessLib/Notation/INotationToMove.cs diff --git a/src/Rudzoft.ChessLib/Notation/MoveNotation.cs b/src/chess-lib/Rudzoft.ChessLib/Notation/MoveNotation.cs similarity index 100% rename from src/Rudzoft.ChessLib/Notation/MoveNotation.cs rename to src/chess-lib/Rudzoft.ChessLib/Notation/MoveNotation.cs diff --git a/src/Rudzoft.ChessLib/Notation/NotationToMove.cs b/src/chess-lib/Rudzoft.ChessLib/Notation/NotationToMove.cs similarity index 100% rename from src/Rudzoft.ChessLib/Notation/NotationToMove.cs rename to src/chess-lib/Rudzoft.ChessLib/Notation/NotationToMove.cs diff --git a/src/Rudzoft.ChessLib/Notation/Notations/CoordinateNotation.cs b/src/chess-lib/Rudzoft.ChessLib/Notation/Notations/CoordinateNotation.cs similarity index 100% rename from src/Rudzoft.ChessLib/Notation/Notations/CoordinateNotation.cs rename to src/chess-lib/Rudzoft.ChessLib/Notation/Notations/CoordinateNotation.cs diff --git a/src/Rudzoft.ChessLib/Notation/Notations/FanNotation.cs b/src/chess-lib/Rudzoft.ChessLib/Notation/Notations/FanNotation.cs similarity index 100% rename from src/Rudzoft.ChessLib/Notation/Notations/FanNotation.cs rename to src/chess-lib/Rudzoft.ChessLib/Notation/Notations/FanNotation.cs diff --git a/src/Rudzoft.ChessLib/Notation/Notations/INotation.cs b/src/chess-lib/Rudzoft.ChessLib/Notation/Notations/INotation.cs similarity index 100% rename from src/Rudzoft.ChessLib/Notation/Notations/INotation.cs rename to src/chess-lib/Rudzoft.ChessLib/Notation/Notations/INotation.cs diff --git a/src/Rudzoft.ChessLib/Notation/Notations/IccfNotation.cs b/src/chess-lib/Rudzoft.ChessLib/Notation/Notations/IccfNotation.cs similarity index 100% rename from src/Rudzoft.ChessLib/Notation/Notations/IccfNotation.cs rename to src/chess-lib/Rudzoft.ChessLib/Notation/Notations/IccfNotation.cs diff --git a/src/Rudzoft.ChessLib/Notation/Notations/LanNotation.cs b/src/chess-lib/Rudzoft.ChessLib/Notation/Notations/LanNotation.cs similarity index 100% rename from src/Rudzoft.ChessLib/Notation/Notations/LanNotation.cs rename to src/chess-lib/Rudzoft.ChessLib/Notation/Notations/LanNotation.cs diff --git a/src/Rudzoft.ChessLib/Notation/Notations/Notation.cs b/src/chess-lib/Rudzoft.ChessLib/Notation/Notations/Notation.cs similarity index 100% rename from src/Rudzoft.ChessLib/Notation/Notations/Notation.cs rename to src/chess-lib/Rudzoft.ChessLib/Notation/Notations/Notation.cs diff --git a/src/Rudzoft.ChessLib/Notation/Notations/RanNotation.cs b/src/chess-lib/Rudzoft.ChessLib/Notation/Notations/RanNotation.cs similarity index 100% rename from src/Rudzoft.ChessLib/Notation/Notations/RanNotation.cs rename to src/chess-lib/Rudzoft.ChessLib/Notation/Notations/RanNotation.cs diff --git a/src/Rudzoft.ChessLib/Notation/Notations/SanNotation.cs b/src/chess-lib/Rudzoft.ChessLib/Notation/Notations/SanNotation.cs similarity index 100% rename from src/Rudzoft.ChessLib/Notation/Notations/SanNotation.cs rename to src/chess-lib/Rudzoft.ChessLib/Notation/Notations/SanNotation.cs diff --git a/src/Rudzoft.ChessLib/Notation/Notations/SmithNotation.cs b/src/chess-lib/Rudzoft.ChessLib/Notation/Notations/SmithNotation.cs similarity index 100% rename from src/Rudzoft.ChessLib/Notation/Notations/SmithNotation.cs rename to src/chess-lib/Rudzoft.ChessLib/Notation/Notations/SmithNotation.cs diff --git a/src/Rudzoft.ChessLib/Notation/Notations/UciNotation.cs b/src/chess-lib/Rudzoft.ChessLib/Notation/Notations/UciNotation.cs similarity index 100% rename from src/Rudzoft.ChessLib/Notation/Notations/UciNotation.cs rename to src/chess-lib/Rudzoft.ChessLib/Notation/Notations/UciNotation.cs diff --git a/src/Rudzoft.ChessLib/Polyglot/IPolyglotBook.cs b/src/chess-lib/Rudzoft.ChessLib/Polyglot/IPolyglotBook.cs similarity index 100% rename from src/Rudzoft.ChessLib/Polyglot/IPolyglotBook.cs rename to src/chess-lib/Rudzoft.ChessLib/Polyglot/IPolyglotBook.cs diff --git a/src/Rudzoft.ChessLib/Polyglot/PolyglotBook.cs b/src/chess-lib/Rudzoft.ChessLib/Polyglot/PolyglotBook.cs similarity index 100% rename from src/Rudzoft.ChessLib/Polyglot/PolyglotBook.cs rename to src/chess-lib/Rudzoft.ChessLib/Polyglot/PolyglotBook.cs diff --git a/src/Rudzoft.ChessLib/Polyglot/PolyglotBookConfiguration.cs b/src/chess-lib/Rudzoft.ChessLib/Polyglot/PolyglotBookConfiguration.cs similarity index 100% rename from src/Rudzoft.ChessLib/Polyglot/PolyglotBookConfiguration.cs rename to src/chess-lib/Rudzoft.ChessLib/Polyglot/PolyglotBookConfiguration.cs diff --git a/src/Rudzoft.ChessLib/Polyglot/PolyglotBookEntry.cs b/src/chess-lib/Rudzoft.ChessLib/Polyglot/PolyglotBookEntry.cs similarity index 100% rename from src/Rudzoft.ChessLib/Polyglot/PolyglotBookEntry.cs rename to src/chess-lib/Rudzoft.ChessLib/Polyglot/PolyglotBookEntry.cs diff --git a/src/Rudzoft.ChessLib/Polyglot/PolyglotBookZobrist.cs b/src/chess-lib/Rudzoft.ChessLib/Polyglot/PolyglotBookZobrist.cs similarity index 100% rename from src/Rudzoft.ChessLib/Polyglot/PolyglotBookZobrist.cs rename to src/chess-lib/Rudzoft.ChessLib/Polyglot/PolyglotBookZobrist.cs diff --git a/src/Rudzoft.ChessLib/Polyglot/ReverseEndianBinaryStreamReader.cs b/src/chess-lib/Rudzoft.ChessLib/Polyglot/ReverseEndianBinaryStreamReader.cs similarity index 100% rename from src/Rudzoft.ChessLib/Polyglot/ReverseEndianBinaryStreamReader.cs rename to src/chess-lib/Rudzoft.ChessLib/Polyglot/ReverseEndianBinaryStreamReader.cs diff --git a/src/Rudzoft.ChessLib/Position.cs b/src/chess-lib/Rudzoft.ChessLib/Position.cs similarity index 100% rename from src/Rudzoft.ChessLib/Position.cs rename to src/chess-lib/Rudzoft.ChessLib/Position.cs diff --git a/src/Rudzoft.ChessLib/Protocol/UCI/Clock.cs b/src/chess-lib/Rudzoft.ChessLib/Protocol/UCI/Clock.cs similarity index 100% rename from src/Rudzoft.ChessLib/Protocol/UCI/Clock.cs rename to src/chess-lib/Rudzoft.ChessLib/Protocol/UCI/Clock.cs diff --git a/src/Rudzoft.ChessLib/Protocol/UCI/CopyProtections.cs b/src/chess-lib/Rudzoft.ChessLib/Protocol/UCI/CopyProtections.cs similarity index 100% rename from src/Rudzoft.ChessLib/Protocol/UCI/CopyProtections.cs rename to src/chess-lib/Rudzoft.ChessLib/Protocol/UCI/CopyProtections.cs diff --git a/src/Rudzoft.ChessLib/Protocol/UCI/Cpu.cs b/src/chess-lib/Rudzoft.ChessLib/Protocol/UCI/Cpu.cs similarity index 100% rename from src/Rudzoft.ChessLib/Protocol/UCI/Cpu.cs rename to src/chess-lib/Rudzoft.ChessLib/Protocol/UCI/Cpu.cs diff --git a/src/Rudzoft.ChessLib/Protocol/UCI/HiResTimer.cs b/src/chess-lib/Rudzoft.ChessLib/Protocol/UCI/HiResTimer.cs similarity index 100% rename from src/Rudzoft.ChessLib/Protocol/UCI/HiResTimer.cs rename to src/chess-lib/Rudzoft.ChessLib/Protocol/UCI/HiResTimer.cs diff --git a/src/Rudzoft.ChessLib/Protocol/UCI/HiResTimerArgs.cs b/src/chess-lib/Rudzoft.ChessLib/Protocol/UCI/HiResTimerArgs.cs similarity index 100% rename from src/Rudzoft.ChessLib/Protocol/UCI/HiResTimerArgs.cs rename to src/chess-lib/Rudzoft.ChessLib/Protocol/UCI/HiResTimerArgs.cs diff --git a/src/Rudzoft.ChessLib/Protocol/UCI/ICpu.cs b/src/chess-lib/Rudzoft.ChessLib/Protocol/UCI/ICpu.cs similarity index 100% rename from src/Rudzoft.ChessLib/Protocol/UCI/ICpu.cs rename to src/chess-lib/Rudzoft.ChessLib/Protocol/UCI/ICpu.cs diff --git a/src/Rudzoft.ChessLib/Protocol/UCI/IHiResTimer.cs b/src/chess-lib/Rudzoft.ChessLib/Protocol/UCI/IHiResTimer.cs similarity index 100% rename from src/Rudzoft.ChessLib/Protocol/UCI/IHiResTimer.cs rename to src/chess-lib/Rudzoft.ChessLib/Protocol/UCI/IHiResTimer.cs diff --git a/src/Rudzoft.ChessLib/Protocol/UCI/IInputOutput.cs b/src/chess-lib/Rudzoft.ChessLib/Protocol/UCI/IInputOutput.cs similarity index 100% rename from src/Rudzoft.ChessLib/Protocol/UCI/IInputOutput.cs rename to src/chess-lib/Rudzoft.ChessLib/Protocol/UCI/IInputOutput.cs diff --git a/src/Rudzoft.ChessLib/Protocol/UCI/IMovesToGoModel.cs b/src/chess-lib/Rudzoft.ChessLib/Protocol/UCI/IMovesToGoModel.cs similarity index 100% rename from src/Rudzoft.ChessLib/Protocol/UCI/IMovesToGoModel.cs rename to src/chess-lib/Rudzoft.ChessLib/Protocol/UCI/IMovesToGoModel.cs diff --git a/src/Rudzoft.ChessLib/Protocol/UCI/IOption.cs b/src/chess-lib/Rudzoft.ChessLib/Protocol/UCI/IOption.cs similarity index 100% rename from src/Rudzoft.ChessLib/Protocol/UCI/IOption.cs rename to src/chess-lib/Rudzoft.ChessLib/Protocol/UCI/IOption.cs diff --git a/src/Rudzoft.ChessLib/Protocol/UCI/ISearchParameters.cs b/src/chess-lib/Rudzoft.ChessLib/Protocol/UCI/ISearchParameters.cs similarity index 100% rename from src/Rudzoft.ChessLib/Protocol/UCI/ISearchParameters.cs rename to src/chess-lib/Rudzoft.ChessLib/Protocol/UCI/ISearchParameters.cs diff --git a/src/Rudzoft.ChessLib/Protocol/UCI/IUci.cs b/src/chess-lib/Rudzoft.ChessLib/Protocol/UCI/IUci.cs similarity index 100% rename from src/Rudzoft.ChessLib/Protocol/UCI/IUci.cs rename to src/chess-lib/Rudzoft.ChessLib/Protocol/UCI/IUci.cs diff --git a/src/Rudzoft.ChessLib/Protocol/UCI/InputOutput.cs b/src/chess-lib/Rudzoft.ChessLib/Protocol/UCI/InputOutput.cs similarity index 100% rename from src/Rudzoft.ChessLib/Protocol/UCI/InputOutput.cs rename to src/chess-lib/Rudzoft.ChessLib/Protocol/UCI/InputOutput.cs diff --git a/src/Rudzoft.ChessLib/Protocol/UCI/InputOutputAction.cs b/src/chess-lib/Rudzoft.ChessLib/Protocol/UCI/InputOutputAction.cs similarity index 100% rename from src/Rudzoft.ChessLib/Protocol/UCI/InputOutputAction.cs rename to src/chess-lib/Rudzoft.ChessLib/Protocol/UCI/InputOutputAction.cs diff --git a/src/Rudzoft.ChessLib/Protocol/UCI/MovesToGoModel.cs b/src/chess-lib/Rudzoft.ChessLib/Protocol/UCI/MovesToGoModel.cs similarity index 100% rename from src/Rudzoft.ChessLib/Protocol/UCI/MovesToGoModel.cs rename to src/chess-lib/Rudzoft.ChessLib/Protocol/UCI/MovesToGoModel.cs diff --git a/src/Rudzoft.ChessLib/Protocol/UCI/Option.cs b/src/chess-lib/Rudzoft.ChessLib/Protocol/UCI/Option.cs similarity index 100% rename from src/Rudzoft.ChessLib/Protocol/UCI/Option.cs rename to src/chess-lib/Rudzoft.ChessLib/Protocol/UCI/Option.cs diff --git a/src/Rudzoft.ChessLib/Protocol/UCI/OptionComparer.cs b/src/chess-lib/Rudzoft.ChessLib/Protocol/UCI/OptionComparer.cs similarity index 100% rename from src/Rudzoft.ChessLib/Protocol/UCI/OptionComparer.cs rename to src/chess-lib/Rudzoft.ChessLib/Protocol/UCI/OptionComparer.cs diff --git a/src/Rudzoft.ChessLib/Protocol/UCI/SearchParameters.cs b/src/chess-lib/Rudzoft.ChessLib/Protocol/UCI/SearchParameters.cs similarity index 100% rename from src/Rudzoft.ChessLib/Protocol/UCI/SearchParameters.cs rename to src/chess-lib/Rudzoft.ChessLib/Protocol/UCI/SearchParameters.cs diff --git a/src/Rudzoft.ChessLib/Protocol/UCI/UCIProtocol.html b/src/chess-lib/Rudzoft.ChessLib/Protocol/UCI/UCIProtocol.html similarity index 100% rename from src/Rudzoft.ChessLib/Protocol/UCI/UCIProtocol.html rename to src/chess-lib/Rudzoft.ChessLib/Protocol/UCI/UCIProtocol.html diff --git a/src/Rudzoft.ChessLib/Protocol/UCI/Uci.cs b/src/chess-lib/Rudzoft.ChessLib/Protocol/UCI/Uci.cs similarity index 100% rename from src/Rudzoft.ChessLib/Protocol/UCI/Uci.cs rename to src/chess-lib/Rudzoft.ChessLib/Protocol/UCI/Uci.cs diff --git a/src/Rudzoft.ChessLib/Protocol/UCI/UciOptionType.cs b/src/chess-lib/Rudzoft.ChessLib/Protocol/UCI/UciOptionType.cs similarity index 100% rename from src/Rudzoft.ChessLib/Protocol/UCI/UciOptionType.cs rename to src/chess-lib/Rudzoft.ChessLib/Protocol/UCI/UciOptionType.cs diff --git a/src/Rudzoft.ChessLib/Rudzoft.ChessLib.csproj b/src/chess-lib/Rudzoft.ChessLib/Rudzoft.ChessLib.csproj similarity index 85% rename from src/Rudzoft.ChessLib/Rudzoft.ChessLib.csproj rename to src/chess-lib/Rudzoft.ChessLib/Rudzoft.ChessLib.csproj index 2e0f2d41..4887c251 100644 --- a/src/Rudzoft.ChessLib/Rudzoft.ChessLib.csproj +++ b/src/chess-lib/Rudzoft.ChessLib/Rudzoft.ChessLib.csproj @@ -18,7 +18,6 @@ Rudzoft.ChessLib README.md chess bitboard datastructure movegeneration magicbb - ChessLib.png Rudzoft.ChessLib https://github.com/rudzen/ChessLib git @@ -36,17 +35,12 @@ + - - - - - True - \ - - - True - + + True + + ChessLib.png diff --git a/src/Rudzoft.ChessLib/State.cs b/src/chess-lib/Rudzoft.ChessLib/State.cs similarity index 100% rename from src/Rudzoft.ChessLib/State.cs rename to src/chess-lib/Rudzoft.ChessLib/State.cs diff --git a/src/Rudzoft.ChessLib/Tables/HashTable.cs b/src/chess-lib/Rudzoft.ChessLib/Tables/HashTable.cs similarity index 100% rename from src/Rudzoft.ChessLib/Tables/HashTable.cs rename to src/chess-lib/Rudzoft.ChessLib/Tables/HashTable.cs diff --git a/src/Rudzoft.ChessLib/Tables/History/HistoryHeuristic.cs b/src/chess-lib/Rudzoft.ChessLib/Tables/History/HistoryHeuristic.cs similarity index 100% rename from src/Rudzoft.ChessLib/Tables/History/HistoryHeuristic.cs rename to src/chess-lib/Rudzoft.ChessLib/Tables/History/HistoryHeuristic.cs diff --git a/src/Rudzoft.ChessLib/Tables/History/IHistoryHeuristic.cs b/src/chess-lib/Rudzoft.ChessLib/Tables/History/IHistoryHeuristic.cs similarity index 100% rename from src/Rudzoft.ChessLib/Tables/History/IHistoryHeuristic.cs rename to src/chess-lib/Rudzoft.ChessLib/Tables/History/IHistoryHeuristic.cs diff --git a/src/Rudzoft.ChessLib/Tables/IHashTable.cs b/src/chess-lib/Rudzoft.ChessLib/Tables/IHashTable.cs similarity index 100% rename from src/Rudzoft.ChessLib/Tables/IHashTable.cs rename to src/chess-lib/Rudzoft.ChessLib/Tables/IHashTable.cs diff --git a/src/Rudzoft.ChessLib/Tables/ITableEntry.cs b/src/chess-lib/Rudzoft.ChessLib/Tables/ITableEntry.cs similarity index 100% rename from src/Rudzoft.ChessLib/Tables/ITableEntry.cs rename to src/chess-lib/Rudzoft.ChessLib/Tables/ITableEntry.cs diff --git a/src/Rudzoft.ChessLib/Tables/KillerMoves/IKillerMoves.cs b/src/chess-lib/Rudzoft.ChessLib/Tables/KillerMoves/IKillerMoves.cs similarity index 100% rename from src/Rudzoft.ChessLib/Tables/KillerMoves/IKillerMoves.cs rename to src/chess-lib/Rudzoft.ChessLib/Tables/KillerMoves/IKillerMoves.cs diff --git a/src/Rudzoft.ChessLib/Tables/KillerMoves/KillerMoves.cs b/src/chess-lib/Rudzoft.ChessLib/Tables/KillerMoves/KillerMoves.cs similarity index 100% rename from src/Rudzoft.ChessLib/Tables/KillerMoves/KillerMoves.cs rename to src/chess-lib/Rudzoft.ChessLib/Tables/KillerMoves/KillerMoves.cs diff --git a/src/Rudzoft.ChessLib/Tables/Perft/IPerftTableEntry.cs b/src/chess-lib/Rudzoft.ChessLib/Tables/Perft/IPerftTableEntry.cs similarity index 100% rename from src/Rudzoft.ChessLib/Tables/Perft/IPerftTableEntry.cs rename to src/chess-lib/Rudzoft.ChessLib/Tables/Perft/IPerftTableEntry.cs diff --git a/src/Rudzoft.ChessLib/Tables/Perft/PerftTable.cs b/src/chess-lib/Rudzoft.ChessLib/Tables/Perft/PerftTable.cs similarity index 100% rename from src/Rudzoft.ChessLib/Tables/Perft/PerftTable.cs rename to src/chess-lib/Rudzoft.ChessLib/Tables/Perft/PerftTable.cs diff --git a/src/Rudzoft.ChessLib/ToDo.md b/src/chess-lib/Rudzoft.ChessLib/ToDo.md similarity index 100% rename from src/Rudzoft.ChessLib/ToDo.md rename to src/chess-lib/Rudzoft.ChessLib/ToDo.md diff --git a/src/Rudzoft.ChessLib/TroubledFens.txt b/src/chess-lib/Rudzoft.ChessLib/TroubledFens.txt similarity index 100% rename from src/Rudzoft.ChessLib/TroubledFens.txt rename to src/chess-lib/Rudzoft.ChessLib/TroubledFens.txt diff --git a/src/Rudzoft.ChessLib/Types/BitBoard.cs b/src/chess-lib/Rudzoft.ChessLib/Types/BitBoard.cs similarity index 100% rename from src/Rudzoft.ChessLib/Types/BitBoard.cs rename to src/chess-lib/Rudzoft.ChessLib/Types/BitBoard.cs diff --git a/src/Rudzoft.ChessLib/Types/BitBoards.cs b/src/chess-lib/Rudzoft.ChessLib/Types/BitBoards.cs similarity index 100% rename from src/Rudzoft.ChessLib/Types/BitBoards.cs rename to src/chess-lib/Rudzoft.ChessLib/Types/BitBoards.cs diff --git a/src/Rudzoft.ChessLib/Types/CastleRight.cs b/src/chess-lib/Rudzoft.ChessLib/Types/CastleRight.cs similarity index 100% rename from src/Rudzoft.ChessLib/Types/CastleRight.cs rename to src/chess-lib/Rudzoft.ChessLib/Types/CastleRight.cs diff --git a/src/Rudzoft.ChessLib/Types/Color.cs b/src/chess-lib/Rudzoft.ChessLib/Types/Color.cs similarity index 100% rename from src/Rudzoft.ChessLib/Types/Color.cs rename to src/chess-lib/Rudzoft.ChessLib/Types/Color.cs diff --git a/src/Rudzoft.ChessLib/Types/Depth.cs b/src/chess-lib/Rudzoft.ChessLib/Types/Depth.cs similarity index 100% rename from src/Rudzoft.ChessLib/Types/Depth.cs rename to src/chess-lib/Rudzoft.ChessLib/Types/Depth.cs diff --git a/src/Rudzoft.ChessLib/Types/Direction.cs b/src/chess-lib/Rudzoft.ChessLib/Types/Direction.cs similarity index 100% rename from src/Rudzoft.ChessLib/Types/Direction.cs rename to src/chess-lib/Rudzoft.ChessLib/Types/Direction.cs diff --git a/src/Rudzoft.ChessLib/Types/File.cs b/src/chess-lib/Rudzoft.ChessLib/Types/File.cs similarity index 100% rename from src/Rudzoft.ChessLib/Types/File.cs rename to src/chess-lib/Rudzoft.ChessLib/Types/File.cs diff --git a/src/Rudzoft.ChessLib/Types/HashKey.cs b/src/chess-lib/Rudzoft.ChessLib/Types/HashKey.cs similarity index 100% rename from src/Rudzoft.ChessLib/Types/HashKey.cs rename to src/chess-lib/Rudzoft.ChessLib/Types/HashKey.cs diff --git a/src/Rudzoft.ChessLib/Types/IPieceSquare.cs b/src/chess-lib/Rudzoft.ChessLib/Types/IPieceSquare.cs similarity index 100% rename from src/Rudzoft.ChessLib/Types/IPieceSquare.cs rename to src/chess-lib/Rudzoft.ChessLib/Types/IPieceSquare.cs diff --git a/src/Rudzoft.ChessLib/Types/IValidationType.cs b/src/chess-lib/Rudzoft.ChessLib/Types/IValidationType.cs similarity index 100% rename from src/Rudzoft.ChessLib/Types/IValidationType.cs rename to src/chess-lib/Rudzoft.ChessLib/Types/IValidationType.cs diff --git a/src/Rudzoft.ChessLib/Types/MagicBB.cs b/src/chess-lib/Rudzoft.ChessLib/Types/MagicBB.cs similarity index 100% rename from src/Rudzoft.ChessLib/Types/MagicBB.cs rename to src/chess-lib/Rudzoft.ChessLib/Types/MagicBB.cs diff --git a/src/Rudzoft.ChessLib/Types/Move.cs b/src/chess-lib/Rudzoft.ChessLib/Types/Move.cs similarity index 100% rename from src/Rudzoft.ChessLib/Types/Move.cs rename to src/chess-lib/Rudzoft.ChessLib/Types/Move.cs diff --git a/src/Rudzoft.ChessLib/Types/Piece.cs b/src/chess-lib/Rudzoft.ChessLib/Types/Piece.cs similarity index 100% rename from src/Rudzoft.ChessLib/Types/Piece.cs rename to src/chess-lib/Rudzoft.ChessLib/Types/Piece.cs diff --git a/src/Rudzoft.ChessLib/Types/PieceSquare.cs b/src/chess-lib/Rudzoft.ChessLib/Types/PieceSquare.cs similarity index 97% rename from src/Rudzoft.ChessLib/Types/PieceSquare.cs rename to src/chess-lib/Rudzoft.ChessLib/Types/PieceSquare.cs index 3ce165cf..a11d1d0b 100644 --- a/src/Rudzoft.ChessLib/Types/PieceSquare.cs +++ b/src/chess-lib/Rudzoft.ChessLib/Types/PieceSquare.cs @@ -1,3 +1,3 @@ -namespace Rudzoft.ChessLib.Types; - -public readonly record struct PieceSquare(Piece Piece, Square Square); +namespace Rudzoft.ChessLib.Types; + +public readonly record struct PieceSquare(Piece Piece, Square Square); diff --git a/src/Rudzoft.ChessLib/Types/PieceSquareEventArgs.cs b/src/chess-lib/Rudzoft.ChessLib/Types/PieceSquareEventArgs.cs similarity index 100% rename from src/Rudzoft.ChessLib/Types/PieceSquareEventArgs.cs rename to src/chess-lib/Rudzoft.ChessLib/Types/PieceSquareEventArgs.cs diff --git a/src/Rudzoft.ChessLib/Types/PieceType.cs b/src/chess-lib/Rudzoft.ChessLib/Types/PieceType.cs similarity index 100% rename from src/Rudzoft.ChessLib/Types/PieceType.cs rename to src/chess-lib/Rudzoft.ChessLib/Types/PieceType.cs diff --git a/src/Rudzoft.ChessLib/Types/Rank.cs b/src/chess-lib/Rudzoft.ChessLib/Types/Rank.cs similarity index 100% rename from src/Rudzoft.ChessLib/Types/Rank.cs rename to src/chess-lib/Rudzoft.ChessLib/Types/Rank.cs diff --git a/src/Rudzoft.ChessLib/Types/RootMove.cs b/src/chess-lib/Rudzoft.ChessLib/Types/RootMove.cs similarity index 97% rename from src/Rudzoft.ChessLib/Types/RootMove.cs rename to src/chess-lib/Rudzoft.ChessLib/Types/RootMove.cs index a216fbb0..9db10b45 100644 --- a/src/Rudzoft.ChessLib/Types/RootMove.cs +++ b/src/chess-lib/Rudzoft.ChessLib/Types/RootMove.cs @@ -1,45 +1,45 @@ -using System.Runtime.CompilerServices; - -namespace Rudzoft.ChessLib.Types; - -public sealed class RootMove : List -{ - public RootMove(Move m) - { - Add(m); - } - - public Value OldValue { get; set; } - - public Value NewValue { get; set; } - - public Depth SelDepth { get; set; } - - public int TbRank { get; set; } - - public Value TbValue { get; set; } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static implicit operator RootMove(Move m) => new(m); - - public static bool operator !=(RootMove left, Move right) => left.FirstOrDefault() != right; - - public static bool operator ==(RootMove left, Move right) => left.FirstOrDefault() == right; - - public static bool operator <(RootMove left, RootMove right) - => left.NewValue > right.NewValue || left.NewValue == right.NewValue && left.OldValue > right.OldValue; - - public static bool operator >(RootMove left, RootMove right) - => left.NewValue < right.NewValue || left.NewValue == right.NewValue && left.OldValue < right.OldValue; - - private bool Equals(RootMove other) => this.FirstOrDefault().Equals(other.FirstOrDefault()); - - public override bool Equals(object obj) => ReferenceEquals(this, obj) || obj is RootMove other && Equals(other); - - public override int GetHashCode() => this.FirstOrDefault().GetHashCode(); -} - -public sealed class RootMoves : List -{ - +using System.Runtime.CompilerServices; + +namespace Rudzoft.ChessLib.Types; + +public sealed class RootMove : List +{ + public RootMove(Move m) + { + Add(m); + } + + public Value OldValue { get; set; } + + public Value NewValue { get; set; } + + public Depth SelDepth { get; set; } + + public int TbRank { get; set; } + + public Value TbValue { get; set; } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator RootMove(Move m) => new(m); + + public static bool operator !=(RootMove left, Move right) => left.FirstOrDefault() != right; + + public static bool operator ==(RootMove left, Move right) => left.FirstOrDefault() == right; + + public static bool operator <(RootMove left, RootMove right) + => left.NewValue > right.NewValue || left.NewValue == right.NewValue && left.OldValue > right.OldValue; + + public static bool operator >(RootMove left, RootMove right) + => left.NewValue < right.NewValue || left.NewValue == right.NewValue && left.OldValue < right.OldValue; + + private bool Equals(RootMove other) => this.FirstOrDefault().Equals(other.FirstOrDefault()); + + public override bool Equals(object obj) => ReferenceEquals(this, obj) || obj is RootMove other && Equals(other); + + public override int GetHashCode() => this.FirstOrDefault().GetHashCode(); +} + +public sealed class RootMoves : List +{ + } \ No newline at end of file diff --git a/src/Rudzoft.ChessLib/Types/Score.cs b/src/chess-lib/Rudzoft.ChessLib/Types/Score.cs similarity index 100% rename from src/Rudzoft.ChessLib/Types/Score.cs rename to src/chess-lib/Rudzoft.ChessLib/Types/Score.cs diff --git a/src/Rudzoft.ChessLib/Types/Square.cs b/src/chess-lib/Rudzoft.ChessLib/Types/Square.cs similarity index 100% rename from src/Rudzoft.ChessLib/Types/Square.cs rename to src/chess-lib/Rudzoft.ChessLib/Types/Square.cs diff --git a/src/Rudzoft.ChessLib/Types/StateStack.cs b/src/chess-lib/Rudzoft.ChessLib/Types/StateStack.cs similarity index 100% rename from src/Rudzoft.ChessLib/Types/StateStack.cs rename to src/chess-lib/Rudzoft.ChessLib/Types/StateStack.cs diff --git a/src/Rudzoft.ChessLib/Types/ValMove.cs b/src/chess-lib/Rudzoft.ChessLib/Types/ValMove.cs similarity index 100% rename from src/Rudzoft.ChessLib/Types/ValMove.cs rename to src/chess-lib/Rudzoft.ChessLib/Types/ValMove.cs diff --git a/src/Rudzoft.ChessLib/Types/Value.cs b/src/chess-lib/Rudzoft.ChessLib/Types/Value.cs similarity index 100% rename from src/Rudzoft.ChessLib/Types/Value.cs rename to src/chess-lib/Rudzoft.ChessLib/Types/Value.cs diff --git a/src/Rudzoft.ChessLib/Types/Values.cs b/src/chess-lib/Rudzoft.ChessLib/Types/Values.cs similarity index 100% rename from src/Rudzoft.ChessLib/Types/Values.cs rename to src/chess-lib/Rudzoft.ChessLib/Types/Values.cs diff --git a/src/Rudzoft.ChessLib/Validation/IPositionValidator.cs b/src/chess-lib/Rudzoft.ChessLib/Validation/IPositionValidator.cs similarity index 100% rename from src/Rudzoft.ChessLib/Validation/IPositionValidator.cs rename to src/chess-lib/Rudzoft.ChessLib/Validation/IPositionValidator.cs diff --git a/src/Rudzoft.ChessLib/Validation/PositionValidationResult.cs b/src/chess-lib/Rudzoft.ChessLib/Validation/PositionValidationResult.cs similarity index 100% rename from src/Rudzoft.ChessLib/Validation/PositionValidationResult.cs rename to src/chess-lib/Rudzoft.ChessLib/Validation/PositionValidationResult.cs diff --git a/src/Rudzoft.ChessLib/Validation/PositionValidator.cs b/src/chess-lib/Rudzoft.ChessLib/Validation/PositionValidator.cs similarity index 100% rename from src/Rudzoft.ChessLib/Validation/PositionValidator.cs rename to src/chess-lib/Rudzoft.ChessLib/Validation/PositionValidator.cs diff --git a/src/perft/Rudzoft.Perft/Rudzoft.Perft.csproj b/src/perft/Rudzoft.Perft/Rudzoft.Perft.csproj index df235a4c..2125cfaf 100644 --- a/src/perft/Rudzoft.Perft/Rudzoft.Perft.csproj +++ b/src/perft/Rudzoft.Perft/Rudzoft.Perft.csproj @@ -18,8 +18,9 @@ - - + + + diff --git a/src/Rudzoft.ChessLib.WebApi/.dockerignore b/src/web-api/Rudzoft.ChessLib.WebApi/.dockerignore similarity index 100% rename from src/Rudzoft.ChessLib.WebApi/.dockerignore rename to src/web-api/Rudzoft.ChessLib.WebApi/.dockerignore diff --git a/src/Rudzoft.ChessLib.WebApi/Controllers/MovesController.cs b/src/web-api/Rudzoft.ChessLib.WebApi/Controllers/MovesController.cs similarity index 100% rename from src/Rudzoft.ChessLib.WebApi/Controllers/MovesController.cs rename to src/web-api/Rudzoft.ChessLib.WebApi/Controllers/MovesController.cs diff --git a/src/Rudzoft.ChessLib.WebApi/Controllers/PgnController.cs b/src/web-api/Rudzoft.ChessLib.WebApi/Controllers/PgnController.cs similarity index 100% rename from src/Rudzoft.ChessLib.WebApi/Controllers/PgnController.cs rename to src/web-api/Rudzoft.ChessLib.WebApi/Controllers/PgnController.cs diff --git a/src/Rudzoft.ChessLib.WebApi/Dockerfile b/src/web-api/Rudzoft.ChessLib.WebApi/Dockerfile similarity index 100% rename from src/Rudzoft.ChessLib.WebApi/Dockerfile rename to src/web-api/Rudzoft.ChessLib.WebApi/Dockerfile diff --git a/src/Rudzoft.ChessLib.WebApi/Moves.cs b/src/web-api/Rudzoft.ChessLib.WebApi/Moves.cs similarity index 100% rename from src/Rudzoft.ChessLib.WebApi/Moves.cs rename to src/web-api/Rudzoft.ChessLib.WebApi/Moves.cs diff --git a/src/Rudzoft.ChessLib.WebApi/Program.cs b/src/web-api/Rudzoft.ChessLib.WebApi/Program.cs similarity index 100% rename from src/Rudzoft.ChessLib.WebApi/Program.cs rename to src/web-api/Rudzoft.ChessLib.WebApi/Program.cs diff --git a/src/Rudzoft.ChessLib.WebApi/Properties/launchSettings.json b/src/web-api/Rudzoft.ChessLib.WebApi/Properties/launchSettings.json similarity index 100% rename from src/Rudzoft.ChessLib.WebApi/Properties/launchSettings.json rename to src/web-api/Rudzoft.ChessLib.WebApi/Properties/launchSettings.json diff --git a/src/Rudzoft.ChessLib.WebApi/Queries/MoveQuery.cs b/src/web-api/Rudzoft.ChessLib.WebApi/Queries/MoveQuery.cs similarity index 100% rename from src/Rudzoft.ChessLib.WebApi/Queries/MoveQuery.cs rename to src/web-api/Rudzoft.ChessLib.WebApi/Queries/MoveQuery.cs diff --git a/src/Rudzoft.ChessLib.WebApi/Rudzoft.ChessLib.WebApi.csproj b/src/web-api/Rudzoft.ChessLib.WebApi/Rudzoft.ChessLib.WebApi.csproj similarity index 78% rename from src/Rudzoft.ChessLib.WebApi/Rudzoft.ChessLib.WebApi.csproj rename to src/web-api/Rudzoft.ChessLib.WebApi/Rudzoft.ChessLib.WebApi.csproj index d48a0997..91dd3759 100644 --- a/src/Rudzoft.ChessLib.WebApi/Rudzoft.ChessLib.WebApi.csproj +++ b/src/web-api/Rudzoft.ChessLib.WebApi/Rudzoft.ChessLib.WebApi.csproj @@ -21,7 +21,12 @@ - + + + + + + diff --git a/src/Rudzoft.ChessLib.WebApi/Services/IMoveGeneratorService.cs b/src/web-api/Rudzoft.ChessLib.WebApi/Services/IMoveGeneratorService.cs similarity index 100% rename from src/Rudzoft.ChessLib.WebApi/Services/IMoveGeneratorService.cs rename to src/web-api/Rudzoft.ChessLib.WebApi/Services/IMoveGeneratorService.cs diff --git a/src/Rudzoft.ChessLib.WebApi/Services/MoveGeneratorService.cs b/src/web-api/Rudzoft.ChessLib.WebApi/Services/MoveGeneratorService.cs similarity index 100% rename from src/Rudzoft.ChessLib.WebApi/Services/MoveGeneratorService.cs rename to src/web-api/Rudzoft.ChessLib.WebApi/Services/MoveGeneratorService.cs diff --git a/src/Rudzoft.ChessLib.WebApi/appsettings.Development.json b/src/web-api/Rudzoft.ChessLib.WebApi/appsettings.Development.json similarity index 100% rename from src/Rudzoft.ChessLib.WebApi/appsettings.Development.json rename to src/web-api/Rudzoft.ChessLib.WebApi/appsettings.Development.json diff --git a/src/Rudzoft.ChessLib.WebApi/appsettings.json b/src/web-api/Rudzoft.ChessLib.WebApi/appsettings.json similarity index 100% rename from src/Rudzoft.ChessLib.WebApi/appsettings.json rename to src/web-api/Rudzoft.ChessLib.WebApi/appsettings.json