public CardDataRT(CardDataRT pCard) { ID = pCard.ID; CardName = pCard.CardName; Description = pCard.Description; IsChainable = pCard.IsChainable; IsAvailable = pCard.IsAvailable; IsDarkCard = pCard.IsDarkCard; AmountPerDeck = pCard.AmountPerDeck; DarkPoints = pCard.DarkPoints; IDCardRarity = pCard.IDCardRarity; IDCardType = pCard.IDCardType; IDCardActivationType = pCard.IDCardActivationType; frontImageBytes = pCard.frontImageBytes; Tags = pCard.Tags; CardTargetFiltters = new List <int>(); for (int i = 0; i < pCard.CardTargetFiltters.Count; i++) { CardTargetFiltters.Add(pCard.CardTargetFiltters[i]); } CardTargetType = new List <int>(); for (int i = 0; i < pCard.CardTargetType.Count; i++) { CardTargetType.Add(pCard.CardTargetType[i]); } }
public async Task <List <CardDataRT> > GetGameCardCollection() { if (DatosFirebaseRTHelper.Instance.isInit == false) { return(null); } List <CardDataRT> allCardList = new List <CardDataRT>(); DatosFirebaseRTHelper.Instance.reference.Child(DatosFirebaseRTHelper.Instance.cardsTable).KeepSynced(true); await DatosFirebaseRTHelper.Instance.reference.Child(DatosFirebaseRTHelper.Instance.cardsTable).GetValueAsync().ContinueWith(task => { if (task.IsFaulted) { //Debug.Log("NoChild"); // Handle the error... } else if (task.IsCompleted) { DataSnapshot snapshot = task.Result; foreach (var child in snapshot.Children) { CardDataRT card = JsonUtility.FromJson <CardDataRT>(child.GetRawJsonValue()); allCardList.Add(card); } } }); return(allCardList); }
public CardData(CardDataRT pCard) { ID = pCard.ID; CardName = pCard.CardName; Description = pCard.Description; IsChainable = pCard.IsChainable; IsAvailable = pCard.IsAvailable; IsDarkCard = pCard.IsDarkCard; AmountPerDeck = pCard.AmountPerDeck; DarkPoints = pCard.DarkPoints; CardRarity = PositionerDemo.CardPropertiesDatabase.GetCardRarityTypeFromInt(pCard.IDCardRarity); CardType = PositionerDemo.CardPropertiesDatabase.GetCardTypeFromInt(pCard.IDCardType); ActivationType = PositionerDemo.CardPropertiesDatabase.GetActivationTypeFromInt(pCard.IDCardActivationType); Tags = pCard.Tags; CardImage = Helper.GetSpriteFromByteArray(pCard.frontImageBytes.ToArray()); cardTargetTypes = PositionerDemo.CardPropertiesDatabase.GetListCardTargetTypeFromListInt(pCard.CardTargetType); cardTargetFiltters = PositionerDemo.CardPropertiesDatabase.GetListCardFiltterFromListInt(pCard.CardTargetFiltters); cardEffects = new List <PositionerDemo.CardEffect>(); }