public void AcceptPreview() { _boardView.ClearHighlights(); if (_previewPickup != null) { if (_move != null) { int oldCount = _move.PickUpMove.PickUpCount; _move.TakeBackMove(_game); _previewPickup = new PickUpMove( _previewPickup.Position, oldCount + _previewPickup.PickUpCount, _game); _boardView.CarryClear(); } _move = new PickupAndPlaceMove(_previewPickup); _move.MakeMove(_game); _boardView.CarryVisible = true; foreach (var pieceID in _move.PickUpMove.PickUpPieces) { _boardView.CarryAdd(pieceID); } _previewPickup = null; } else if (_previewPlace != null) { _move.AddToChain(_previewPlace); _previewPlace = null; } }
public void Cancel() { CancelPreview(); if (_move != null) { _move.TakeBackMove(_game); _boardView.InvalidateRender(); _move = null; } _boardView.CarryClear(); }