Esempio n. 1
0
        public void SetCard(int index, bool value)
        {
            CardValues card = cards[index];

            card.enabled = value;
            cards[index] = card;
        }
Esempio n. 2
0
        public Card GetDiscardTopCard()
        {
            Card res = DiscardStackTop;

            discardStack.RemoveAt(discardStack.Count - 1);
            discardTopCard = DiscardStackTop.Struct;
            return(res);
        }
Esempio n. 3
0
        public void AddCard(int index, CardValues cs, IPlayerView iPlayerView = null)
        {
            GameObject prefab = GetPrefab();
            ICardView  cv     = Instantiate(prefab, transform).GetComponent <ICardView>();

            cv.SetIndex(index);
            cv.SetCard(cs);
            cv.IPlayerView = iPlayerView;
            list.Add(cv);
        }
Esempio n. 4
0
 protected void SetSuitRank(Suit suit = Suit.Null, Rank rank = Rank.Null)
 {
     Struct = new CardValues
     {
         suit  = suit,
         rank  = rank,
         name  = ToString(),
         color = Color
     };
 }
Esempio n. 5
0
        public void ShuffleCards(List <Card> temp)
        {
            Card c;
            int  random;

            while (temp.Count > 0)
            {
                random = Random.Range(0, temp.Count);
                c      = temp[random];
                temp.RemoveAt(random);
                AddCardToDeck(c);
            }
            discardTopCard = CardValues.Null;
        }
Esempio n. 6
0
        private void OnCardsUpdated(SyncListCard.Operation op, int index, CardValues oldValue, CardValues newValue)
        {
            switch (op)
            {
            case SyncListCard.Operation.OP_ADD:
                PlayerView.LocalPlayer.AddHandCard(index, newValue);
                break;

            case SyncListCard.Operation.OP_REMOVEAT:
                PlayerView.LocalPlayer.RemoveHandCard(index);
                break;

            case SyncListCard.Operation.OP_SET:
                PlayerView.LocalPlayer.EnableCard(index, newValue.enabled);
                break;
            }
        }
        public void SetCards(List <Card> cards, NetworkConnection conn = null)
        {
            int length = cards.Count;

            CardValues[] cardStructs = new CardValues[length];
            for (int i = 0; i < length; i++)
            {
                cardStructs[i] = cards[i].Struct;
            }

            AddCards(cardStructs, conn);

            if (conn != null)
            {
                TargetEnableCards(conn, true);
            }
        }
Esempio n. 8
0
 public void AddCard(CardValues card)
 {
     cards.Add(card);
 }
Esempio n. 9
0
 public void SetCard(CardValues cs)
 {
     SetName(cs.name, cs.color);
     SetRank(cs.rank);
     SetSuit(cs.suit);
 }
Esempio n. 10
0
 public void EquipWeapon(CardValues cs)
 {
     weaponCard.SetCard(cs);
 }
Esempio n. 11
0
 public void EquipProperty(int index, CardValues cs)
 {
     propertyCards.AddCard(index, cs, this);
 }
Esempio n. 12
0
 public void AddHandCard(int index, CardValues cs)
 {
     handCards.AddCard(index, cs, this);
 }
Esempio n. 13
0
 public void SetDiscardTop(CardValues cs)
 {
     discardTopCard.SetCard(cs);
 }
Esempio n. 14
0
 public void DiscardCard(Card card)
 {
     discardStack.Add(card);
     discardTopCard = card.Struct;
 }
Esempio n. 15
0
 private void UpdateDiscardTopCard(CardValues discardCard)
 {
     discardView.SetDiscardTop(discardCard);
 }