示例#1
0
        // TODO: Refactor arguments
        public void RetakePiece(Position position, ChessPiece chessPiece)
        {
            var entries = CapturedPieceCollection.GetEntryCount(chessPiece);

            if (entries == 0)
            {
                // TODO: Maybe send notification
                return;
            }

            var box = this[position];

            box.Piece = chessPiece;
            CapturedPieceCollection.DecrementEntry(chessPiece);

            NextTurn();
            RetakingIsActive = false;
        }