private bool WasInLastTurn(Element el) { Info.Turn lastTurn = info.lastTurn; return(lastTurn != null && ( GetElementByPoint(lastTurn.from) == el || GetElementByPoint(lastTurn.to) == el )); }
private void AddSwapAnimation(Info.Turn turn, EventHandler onEnd = null) { Element from = GetElementByPoint(turn.from); Element to = GetElementByPoint(turn.to); AddMoveAnimation(to, GetRectangleByColAndRow(turn.from.X, turn.from.Y)); MoveElementAnimation moveSelectedAnimation = AddMoveAnimation(from, GetRectangleByColAndRow(turn.to.X, turn.to.Y)); if (onEnd != null) { moveSelectedAnimation.onEnd += onEnd; } }