private void AutoSelect(CardViewModel card) { Utils.WriteLine("Auto-selecting: {0}", card); if (card.Column == -1 && card.Row == -1) { Deal(); ResetMoveAndRefresh(); return; } Tableau.FromCard = card; int firstSpace = Tableau.FirstSpace; if (firstSpace == -1) { ResetMoveAndRefresh(); return; } Tableau.ToCard = Tableau.Piles[firstSpace][0]; if (Tableau.TryMove()) { AddCheckPoint(); ResetMoveAndRefresh(); return; } ResetMoveAndRefresh(); }
private void MoveSelect(CardViewModel card) { Utils.WriteLine("MoveSelecting: {0}", card); if (card == null) { ResetMoveAndRefresh(); return; } if (Tableau.FromCard == null) { Tableau.FromCard = card; Refresh(); return; } Tableau.ToCard = card; if (Tableau.FromCard.Column == Tableau.ToCard.Column) { ResetMoveAndRefresh(); return; } if (Tableau.TryMove()) { AddCheckPoint(); ResetMoveAndRefresh(); return; } ResetMoveAndRefresh(); }
public bool TryMove() { Move move = new Move(FromCard.Column, FromCard.Row, ToCard.Column); return(Tableau.TryMove(move)); }