Пример #1
0
        public void Init()
        {
            DoubleBuffered = true;
            for (int i = 1; i <= 10; i++)
            {
                var cardSlot1 = new CardSlot();
                cardSlot1.IsSelected = false;
                cardSlot1.Location = new System.Drawing.Point(120 * i - 120, 0);
                cardSlot1.Size = new System.Drawing.Size(120, 150);

                cardSlot1.SetSlotCard(ActiveCards.NoneCard);
                cards[i - 1] = cardSlot1;
            }
        }
Пример #2
0
        private void InstallCards()
        {
            var deckCards = cardList.GetAllCard();
            for (int i = 0; i < GameConstants.BattleInitialCardCount; i++)
            {
                var card = new CardSlot();
                card.SetSlotCard(deckCards[i]);
                card.Location = new Point(200 * i, 0);
                card.Size = new Size(120, 120);
                card.BgColor = Color.Black;

                cards[i] = card;
            }
        }
Пример #3
0
        public void Init()
        {
            DoubleBuffered = true;
            for (int i = 1; i <= 10; i++)
            {
                var cardSlot1 = new CardSlot();
                cardSlot1.IsSelected = false;
                cardSlot1.Location   = new System.Drawing.Point(120 * i - 120, 0);
                cardSlot1.Size       = new System.Drawing.Size(120, 150);

                cardSlot1.SetSlotCard(ActiveCards.NoneCard);
                cards[i - 1] = cardSlot1;
            }
        }
Пример #4
0
        private void UpdateCards()
        {
            cards = new List <CardSlot>();
            var deckCards = selectMethod.GetCards();
            var margin    = (Width - 2 * 150 - 120) / (deckCards.Length - 1); //所以必须至少2选一,不然会除零错

            for (int i = 0; i < deckCards.Length; i++)
            {
                var card = new CardSlot();
                card.SetSlotCard(deckCards[i]);
                card.Location = new Point(margin * i + 150, 100);
                card.Size     = new Size(120, 120);
                card.BgColor  = Color.Transparent;

                cards.Add(card);
            }
        }