Beispiel #1
0
 public override void CheckMissed(CardResultCallback resultCallback)
 {
     if(IsOnTable && !playBlocked)
         OnCheckMissed(resultCallback);
     else
         throw new BadCardException();
 }
Beispiel #2
0
 public virtual void CheckMissed(CardResultCallback resultCallback)
 {
     throw new BadUsageException();
 }
Beispiel #3
0
 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);
 }
Beispiel #4
0
 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;
 }
Beispiel #5
0
 public void AddHandler(Card causedBy, CheckDeckCallback checkCallback, CardResultCallback resultCallback)
 {
     AddHandler(new LuckyDukeResponseHandler(parent, causedBy, checkCallback, resultCallback));
 }
Beispiel #6
0
 public override void CheckDeck(Card causedBy, CheckDeckCallback checkCallback, CardResultCallback resultCallback)
 {
     queue.AddHandler(causedBy, checkCallback, resultCallback);
     if(!queue.Active)
         Game.GameCycle.PushTempHandler(queue);
 }
Beispiel #7
0
 protected override void OnCheckMissed(CardResultCallback resultCallback)
 {
     PerformCheck(resultCallback);
 }
Beispiel #8
0
 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);
         }));
 }
Beispiel #9
0
 public override void CheckMissed(CardResultCallback resultCallback)
 {
     resultCallback(this, true);
 }
Beispiel #10
0
 protected virtual void OnCheckMissed(CardResultCallback resultCallback)
 {
     throw new BadCardException();
 }
Beispiel #11
0
 public void CheckMissed(Card card, CardResultCallback resultCallback)
 {
     if(character.IsMissed(card))
         try
         {
             card.CheckMissed(resultCallback);
         }
         catch(GameException)
         {
             resultCallback(card, true);
         }
     else
         card.CheckMissed(resultCallback);
 }
Beispiel #12
0
 public void CheckDeck(Card causedBy, CheckDeckCallback checkCallback, CardResultCallback resultCallback)
 {
     character.CheckDeck(causedBy, checkCallback, resultCallback);
 }
Beispiel #13
0
 public override void CheckMissed(CardResultCallback resultCallback)
 {
     OnUsedAbility();
     barrel.PerformCheck(resultCallback);
 }
Beispiel #14
0
 public override void CheckMissed(CardResultCallback resultCallback)
 {
     Player owner = Owner;
     resultCallback(this, true);
     Game.GameTable.PlayerDrawFromDeck(owner, 1);
 }
Beispiel #15
0
 public void PerformCheck(CardResultCallback resultCallback)
 {
     Owner.CheckDeck(this, c => c.Suit == CardSuit.Hearts, resultCallback);
 }
Beispiel #16
0
 protected override void OnCheckMissed(CardResultCallback resultCallback)
 {
     resultCallback(this, true);
 }
Beispiel #17
0
 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);
         }));
 }