Exemple #1
0
        public void Update(IEnumerable <Card> listOfCards)
        {
            Reset();
            var hardware = Services.Container.GetInstance <IHardwareConstants>();
            var meleeY   = hardware.OurMeleeRowLocation.Y + hardware.OurMeleeRowLocation.Height / 2;
            var rangedY  = hardware.OurRangedRowLocation.Y + hardware.OurRangedRowLocation.Height / 2;

            foreach (var card in listOfCards)
            {
                if (card.Confidence < hardware.CardDetectionMinimalConfidenceLevel)
                {
                    continue;
                }
                var center = new Point(card.X + card.Width / 2, card.Y + card.Height / 2);
                if (Utility.IsInZone(hardware.BoardLocation, center))
                {
                    MyCards.Add(card);
                    var cardY = card.Y + card.Height / 2;
                    if (Math.Abs(cardY - meleeY) < Math.Abs(cardY - rangedY))
                    {
                        MeleeSize++;
                    }
                    else
                    {
                        RangedSize++;
                    }
                }
            }
        }
 //Used to build up a hand of cards
 void AddCardToHand(string card)
 {
     if (!MyCards.Contains(card))
     {
         MyCards.Add(card);
     }
     else
     {
         //Can't place 2 of the same card in your hand
         MessageBox.Show($"Add Card Command Failed: " + card + " was already in your hand ");
     }
 }
Exemple #3
0
 public void RequestACard(Card card)
 {
     MyCards.Add(card);
     //MyHand.AddACard(card);
 }