Ejemplo n.º 1
0
        public bool Move(ChessBoxState actualPlayer, Move move)
        {
            ValidateMove(actualPlayer, move);
            ChangeSet     step      = new ChangeSet(move);
            ChessBoxState stateFrom = desk.GetState(move.From);
            ChessBoxState stateTo   = desk.GetState(move.To);

            step.AddChange(move.From, stateFrom, ChessBoxState.Empty);
            step.AddChange(move.To, stateTo, stateFrom);
            step.AddChangesRange(MoveEffects(actualPlayer, move));
            desk.DoStep(step);
            Moved?.Invoke(this, step);
            return(true);
        }