public void SetCard(int index, bool value) { CardValues card = cards[index]; card.enabled = value; cards[index] = card; }
public Card GetDiscardTopCard() { Card res = DiscardStackTop; discardStack.RemoveAt(discardStack.Count - 1); discardTopCard = DiscardStackTop.Struct; return(res); }
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); }
protected void SetSuitRank(Suit suit = Suit.Null, Rank rank = Rank.Null) { Struct = new CardValues { suit = suit, rank = rank, name = ToString(), color = Color }; }
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; }
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); } }
public void AddCard(CardValues card) { cards.Add(card); }
public void SetCard(CardValues cs) { SetName(cs.name, cs.color); SetRank(cs.rank); SetSuit(cs.suit); }
public void EquipWeapon(CardValues cs) { weaponCard.SetCard(cs); }
public void EquipProperty(int index, CardValues cs) { propertyCards.AddCard(index, cs, this); }
public void AddHandCard(int index, CardValues cs) { handCards.AddCard(index, cs, this); }
public void SetDiscardTop(CardValues cs) { discardTopCard.SetCard(cs); }
public void DiscardCard(Card card) { discardStack.Add(card); discardTopCard = card.Struct; }
private void UpdateDiscardTopCard(CardValues discardCard) { discardView.SetDiscardTop(discardCard); }