Exemple #1
0
 private bool WasInLastTurn(Element el)
 {
     Info.Turn lastTurn = info.lastTurn;
     return(lastTurn != null && (
                GetElementByPoint(lastTurn.from) == el ||
                GetElementByPoint(lastTurn.to) == el
                ));
 }
Exemple #2
0
        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;
            }
        }