public void MoveTo(Deck deck) { if (TopCard.Value > 0) { deck.Add(TopCard); Remove(); } }
private void MoveFromGeneral(Deck to, Random random, bool useDifficulty = true) { int left = _generalDeck.Count; if (useDifficulty) { left += _options.Difficulty - MaxDifficulty; } int index = random.Next(0, left); Card addCard = _generalDeck[index]; to.Add(addCard); _generalDeck.RemoveAt(index); }
public bool TryMove(Deck to) { if (_selected.TryMove(to)) { DeleteOldSteps(); AddNewStep(); ModifyScore(_selected, to); SaveMovement(_selected.Name, to.Name); if (to.Type == DeckType.Result) { var deck = (ResultDeck) to; if (deck.DisabledSuit != null) { LastStep.DisabledSuit = deck.DisabledSuit; deck.DisabledSuit = null; } } NotifyCardsChanged(); return true; } return false; }
public void Select(Deck deck) { _isSomethingSelected = true; _selected = deck; }
public void ModifyScore(Deck from, Deck to) { int change = ScoreCounter.CountChange(from, to); Score += change; LastStep.ScoreIncreased = change; }
public virtual bool TryMove(Deck deck) { if (deck.CanPutOnTop(TopCard)) { MoveTo(deck); return true; } return false; }
public override bool TryMove(Deck deck) { return false; }
private void MakeStep(Border border, Deck deck) { if (MyGame.IsSomethingSelected) { MakeAction(border, MyGame.TryMove(deck)); } else { MyGame.Select(deck); MakeSelected(border); } CheckWin(); }