Exemple #1
0
        private static StreamlootsCard GetCard(JObject cardObject)
        {
            StreamlootsCard streamlootsCard = GetStreamlootsObject <StreamlootsCard>(cardObject);

            streamlootsCard.Initialize();
            return(streamlootsCard);
        }
Exemple #2
0
        void ShowCardRedeemed(StreamlootsCard card)
        {
            CardDto cardDto = new CardDto(card);

            ShowCardEvent(cardDto);
            OnCardRedeemed(this, new CardEventArgs(cardDto));
        }
Exemple #3
0
        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();
            //}
        }
Exemple #4
0
        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;
            }
        }