public void CastData() { if (!string.IsNullOrEmpty(Skill)) { OverlordSkill = Utilites.CastStringTuEnum <Enumerators.OverlordSkill>(Skill); } if (!string.IsNullOrEmpty(SkillTargets)) { SkillTargetTypes = Utilites.CastList <Enumerators.SkillTargetType>(SkillTargets); } else { SkillTargetTypes = new List <Enumerators.SkillTargetType>(); } if (!string.IsNullOrEmpty(ElementTargets)) { ElementTargetTypes = Utilites.CastList <Enumerators.SetType>(ElementTargets); } else { ElementTargetTypes = new List <Enumerators.SetType>(); } }
public void CastData() { foreach (Hero item in Heroes) { item.HeroElement = Utilites.CastStringTuEnum <Enumerators.SetType>(item.Element); item.CastSkills(); item.ValidateSkillLocking(); } _casted = true; }
public void FillAllCards() { _allCards = new List <Card>(); int id = 0; if (Sets != null) { foreach (CardSet set in Sets) { foreach (Card card in set.Cards) { card.CardSetType = (Enumerators.SetType)Enum.Parse(typeof(Enumerators.SetType), set.Name.ToUpper()); // todo improve this shit! if (card.Kind != null) { card.CardKind = Utilites.CastStringTuEnum <Enumerators.CardKind>(card.Kind); } if (card.Rank != null) { card.CardRank = Utilites.CastStringTuEnum <Enumerators.CardRank>(card.Rank); } if (card.Type != null) { card.CardType = Utilites.CastStringTuEnum <Enumerators.CardType>(card.Type); } foreach (AbilityData ability in card.Abilities) { ability.ParseData(); } _allCards.Add(card); if (card.CardSetType != Enumerators.SetType.OTHERS) { card.Id = id; } id++; } } } SortCardsByRank(); }
public void ParseData() { AbilityType = Utilites.CastStringTuEnum <Enumerators.AbilityType>(Type); AbilityActivityType = Utilites.CastStringTuEnum <Enumerators.AbilityActivityType>(ActivityType); AbilityCallType = Utilites.CastStringTuEnum <Enumerators.AbilityCallType>(CallType); if (!string.IsNullOrEmpty(TargetType)) { AbilityTargetTypes = Utilites.CastList <Enumerators.AbilityTargetType>(TargetType); } else { AbilityTargetTypes = new List <Enumerators.AbilityTargetType>(); } if (!string.IsNullOrEmpty(StatType)) { AbilityStatType = Utilites.CastStringTuEnum <Enumerators.StatType>(StatType); } else { AbilityStatType = Enumerators.StatType.NONE; } if (!string.IsNullOrEmpty(SetType)) { AbilitySetType = Utilites.CastStringTuEnum <Enumerators.SetType>(SetType); } else { AbilitySetType = Enumerators.SetType.NONE; } if (!string.IsNullOrEmpty(EffectType)) { AbilityEffectType = Utilites.CastStringTuEnum <Enumerators.AbilityEffectType>(EffectType); } else { AbilityEffectType = Enumerators.AbilityEffectType.NONE; } if (!string.IsNullOrEmpty(AttackInfo)) { AttackInfoType = Utilites.CastStringTuEnum <Enumerators.AttackInfoType>(AttackInfo); } else { AttackInfoType = Enumerators.AttackInfoType.ANY; } if (!string.IsNullOrEmpty(CardType)) { TargetCardType = Utilites.CastStringTuEnum <Enumerators.CardType>(CardType); } else { TargetCardType = Enumerators.CardType.NONE; } if (!string.IsNullOrEmpty(UnitStatus)) { TargetUnitStatusType = Utilites.CastStringTuEnum <Enumerators.UnitStatusType>(UnitStatus); } else { TargetUnitStatusType = Enumerators.UnitStatusType.NONE; } if (!string.IsNullOrEmpty(UnitType)) { TargetUnitType = Utilites.CastStringTuEnum <Enumerators.CardType>(UnitType); } }