internal void OnMovePlayed(MoveOperations moveOperations) { foreach (var move in moveOperations.MovedPieces) { ResetPiecesMobility(move.MovedPiece, move.StartingSquare, move.EndingSquare); } }
internal override MoveOperations GetMoveOperations() { var ret = new MoveOperations(MovedPiece.Color); ret.CapturedPieces.Add(CapturedPiece); ret.AddedPieces.Add(new PieceCoordinatePair(MovedPiece, EndingSquare.Coordinate)); return(ret); }
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); }
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); }
internal void OnMovePlayed(MoveOperations moveOperations) { foreach (var pieceMove in moveOperations.MovedPieces) { OnPieceMoved(pieceMove); } foreach (var capturedPiece in moveOperations.CapturedPieces) { OnPieceCaptured(capturedPiece); } }
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); } }
internal void OnMovePlayed(MoveOperations moveOperations) { _controlManager.OnMovePlayed(moveOperations); _mobilityManager.OnMovePlayed(moveOperations); }