public void WasExplosion() { CardListInfo cl = this.CardLists[CardType.EXPLOSION]; cl.CardRemained--; this.CardLists[CardType.EXPLOSION] = cl; }
public void ReturnToTheDeck(GameObject cardGO) { Card card = cardGO.GetComponent <CardControl>().Card; GameManagerSrc.Instance.AddToDeckStorage(cardGO); CardType type = GetType(card); CardListInfo cl = CardLists[type]; cl.ExistincCards.Push(card); CardLists[type] = cl; }
public Card GetCardWithoutLosing(CardType type) { try { CardListInfo CardList = CardLists[type]; // До добавляния карт Взрыва и Обезвреживания может возникнуть исключение if (CardList.CardRemained > 0) { return(CardList.ExistincCards.Count != 0 ? CardList.ExistincCards.Pop() : CardList.CardTemplates.Clone() as Card); } } catch (Exception) { } return(null); }
private CreditAccount GetAccountInfo(CardListInfo account) { var accountInfo = new CreditAccount() { Name = account.CardName, Club = account.Club1, UserName = account.UserName, CardNumber = Convert.ToString(account.CardNumber), BankAccount = $"{account.BankId}-{account.BankBranchId}-{account.BankAccountId}", BankName = account.BankName }; return(accountInfo); }
public Card GetCard(CardType type) { try { CardListInfo CardList = CardLists[type]; // До добавляния карт Взрыва и Обезвреживания может возникнуть исключение if (CardList.CardRemained > 0) { if (type != CardType.EXPLOSION) { CardList.CardRemained--; } Card resultCard = CardList.ExistincCards.Count != 0 ? CardList.ExistincCards.Pop() : CardList.CardTemplates.Clone() as Card; CardLists[type] = CardList; // CardList это просто копия CardLists[type], поэтому синхронизируем изменения return(resultCard); } } catch (Exception) { } return(null); }