Пример #1
0
 internal void OnMovePlayed(MoveOperations moveOperations)
 {
     foreach (var move in moveOperations.MovedPieces)
     {
         ResetPiecesMobility(move.MovedPiece,
                             move.StartingSquare,
                             move.EndingSquare);
     }
 }
Пример #2
0
        internal override MoveOperations GetMoveOperations()
        {
            var ret = new MoveOperations(MovedPiece.Color);

            ret.CapturedPieces.Add(CapturedPiece);
            ret.AddedPieces.Add(new PieceCoordinatePair(MovedPiece, EndingSquare.Coordinate));

            return(ret);
        }
Пример #3
0
        internal override MoveOperations GetMoveOperations()
        {
            var ret = new MoveOperations(King.Color);

            ret.MovedPieces.Add(new PieceMoveInfo(King, StartingSquare, EndingSquare));
            ret.MovedPieces.Add(new PieceMoveInfo(_rook, _rookStartingPosition, _rookEndingPosition));

            return(ret);
        }
Пример #4
0
        internal virtual MoveOperations GetMoveOperations()
        {
            var ret = new MoveOperations(MovedPiece.Color);

            if (IsCapture)
            {
                ret.CapturedPieces.Add(CapturedPiece);
            }
            ret.MovedPieces.Add(new PieceMoveInfo(MovedPiece, StartingSquare, EndingSquare));
            return(ret);
        }
Пример #5
0
        internal void OnMovePlayed(MoveOperations moveOperations)
        {
            foreach (var pieceMove in moveOperations.MovedPieces)
            {
                OnPieceMoved(pieceMove);
            }

            foreach (var capturedPiece in moveOperations.CapturedPieces)
            {
                OnPieceCaptured(capturedPiece);
            }
        }
Пример #6
0
        private void PerformMoveOperations(MoveOperations operations)
        {
            foreach (var pair in operations.AddedPieces)
            {
                AddPiece(pair);
            }
            _piecesInfluenceManager.AddPieces(operations.AddedPieces.Select(p => p.Piece));

            foreach (var piece in operations.CapturedPieces)
            {
                RemovePiece(piece);
            }

            foreach (var move in operations.MovedPieces)
            {
                MovePiece(move);
            }
        }
Пример #7
0
 internal void OnMovePlayed(MoveOperations moveOperations)
 {
     _controlManager.OnMovePlayed(moveOperations);
     _mobilityManager.OnMovePlayed(moveOperations);
 }