private static StreamlootsCard GetCard(JObject cardObject) { StreamlootsCard streamlootsCard = GetStreamlootsObject <StreamlootsCard>(cardObject); streamlootsCard.Initialize(); return(streamlootsCard); }
void ShowCardRedeemed(StreamlootsCard card) { CardDto cardDto = new CardDto(card); ShowCardEvent(cardDto); OnCardRedeemed(this, new CardEventArgs(cardDto)); }
private void ProcessCardRedemption(JObject cardObject) { StreamlootsCard card = GetCard(cardObject); ShowCardRedeemed(card); //if (card != null) //{ // Console.WriteLine("Card Name: " + card.CardName); // Console.WriteLine("Card Image: " + card.imageUrl); // Console.WriteLine("Card Sound: " + card.soundUrl); // Console.WriteLine("Redeemed By: " + card.UserName); // Console.WriteLine("Message: " + card.message); // Console.WriteLine("Secret: " + card.GetField("secret")); // Console.WriteLine(); //} }
public CardDto(StreamlootsCard card) { InstanceID = Guid.NewGuid().ToString(); Card = card; OwningCharacterId = GetCreatureId(card.Recipient); TargetCharacterIds = GetCreatureIds(card.Target); bool hasTarget = TargetCharacterIds.Any(); bool hasOwner = OwningCharacterId != int.MinValue; if (hasTarget && NeedToRollDice) { Command = CMD_PlayCardWithTarget; } else if (!hasTarget && !hasOwner) { Command = CMD_PlayCardNow; } else { Command = CMD_ShowCard; } }