public override void CheckMissed(CardResultCallback resultCallback) { if(IsOnTable && !playBlocked) OnCheckMissed(resultCallback); else throw new BadCardException(); }
public virtual void CheckMissed(CardResultCallback resultCallback) { throw new BadUsageException(); }
public virtual void CheckDeck(Card causedBy, CheckDeckCallback checkCallback, CardResultCallback resultCallback) { Card checkedCard = player.Game.GameTable.CheckDeck(); bool result = checkCallback(checkedCard); Game.Session.EventManager.OnPlayerCheckedDeck(player, checkedCard, causedBy, result); resultCallback(causedBy, result); }
public LuckyDukeResponseHandler(LuckyDuke parent, Card causedBy, CheckDeckCallback checkCallback, CardResultCallback resultCallback) : base(RequestType.LuckyDuke, parent.Player) { this.parent = parent; this.causedBy = causedBy; this.checkCallback = checkCallback; this.resultCallback = resultCallback; }
public void AddHandler(Card causedBy, CheckDeckCallback checkCallback, CardResultCallback resultCallback) { AddHandler(new LuckyDukeResponseHandler(parent, causedBy, checkCallback, resultCallback)); }
public override void CheckDeck(Card causedBy, CheckDeckCallback checkCallback, CardResultCallback resultCallback) { queue.AddHandler(causedBy, checkCallback, resultCallback); if(!queue.Active) Game.GameCycle.PushTempHandler(queue); }
protected override void OnCheckMissed(CardResultCallback resultCallback) { PerformCheck(resultCallback); }
public override void CheckMissed(CardResultCallback resultCallback) { if(characters.Count == 0) base.CheckMissed(resultCallback); else if(characters.Count == 1) characters.First().CheckMissed(resultCallback); else Game.GameCycle.PushTempHandler(new ChooseCharacterResponseHandler(this, RequestType.ChooseCharacterForAvoidShot, c => { if(c != null) c.CheckMissed(resultCallback); else base.CheckMissed(resultCallback); })); }
public override void CheckMissed(CardResultCallback resultCallback) { resultCallback(this, true); }
protected virtual void OnCheckMissed(CardResultCallback resultCallback) { throw new BadCardException(); }
public void CheckMissed(Card card, CardResultCallback resultCallback) { if(character.IsMissed(card)) try { card.CheckMissed(resultCallback); } catch(GameException) { resultCallback(card, true); } else card.CheckMissed(resultCallback); }
public void CheckDeck(Card causedBy, CheckDeckCallback checkCallback, CardResultCallback resultCallback) { character.CheckDeck(causedBy, checkCallback, resultCallback); }
public override void CheckMissed(CardResultCallback resultCallback) { OnUsedAbility(); barrel.PerformCheck(resultCallback); }
public override void CheckMissed(CardResultCallback resultCallback) { Player owner = Owner; resultCallback(this, true); Game.GameTable.PlayerDrawFromDeck(owner, 1); }
public void PerformCheck(CardResultCallback resultCallback) { Owner.CheckDeck(this, c => c.Suit == CardSuit.Hearts, resultCallback); }
protected override void OnCheckMissed(CardResultCallback resultCallback) { resultCallback(this, true); }
public override void CheckDeck(Card causedBy, CheckDeckCallback checkCallback, CardResultCallback resultCallback) { if(characters.Count == 0) base.CheckDeck(causedBy, checkCallback, resultCallback); else if(characters.Count == 1) characters.First().CheckDeck(causedBy, checkCallback, resultCallback); else Game.GameCycle.PushTempHandler(new ChooseCharacterResponseHandler(this, RequestType.ChooseCharacterForCheckDeck, c => { if(c != null) c.CheckDeck(causedBy, checkCallback, resultCallback); else base.CheckDeck(causedBy, checkCallback, resultCallback); })); }