/// <summary> /// Add points to LogicPlayer::expPoints and increase level if is available. /// </summary> /// <param name="expPoints">The experience points.</param> internal void XpGainHelper(int expPoints) { if (expPoints > 0) { ExperienceLevelData Data = (ExperienceLevelData)CSV.Tables.Get(Gamefile.ExperienceLevel).GetDataWithInstanceID(this.ExpLevel - 1); this.ExpPoints += expPoints; if (this.ExpPoints >= Data.ExpPoints) { if (this.ExpPoints + expPoints >= Data.ExpPoints) { if (CSV.Tables.Get(Gamefile.ExperienceLevel).Datas.Count > this.ExpLevel) { this.ExpPoints -= Data.ExpPoints; this.ExpLevel++; } } else { this.ExpPoints = Data.ExpPoints; } } } }
internal void AddExperience(int ExpPoints) { ExperienceLevelData ExperienceData = (ExperienceLevelData)CSV.Tables.Get(Gamefile.Experience_Levels).GetDataWithID(this.ExpLevel - 1); this.ExpPoints += ExpPoints; if (this.ExpPoints >= ExperienceData?.ExpPoints) { this.ExpLevel++; this.ExpPoints -= ExperienceData.ExpPoints; } }
internal void AddExperience(int xp) { if (xp > 0) { ExperienceLevelData ed = (ExperienceLevelData)CSV.Tables.Get(Gamefile.Experience_Levels).GetDataWithID(this.ExpLevel - 1); this.ExpPoints += xp; if (this.ExpPoints >= ed?.ExpPoints) { this.ExpLevel++; this.ExpPoints -= ed.ExpPoints; } } }
/// <summary> /// Creates the data for the specified row. /// </summary> /// <param name="Row">The row.</param> internal Data Create(Row Row) { Data Data; switch (this.Index) { case 1: { Data = new BuildingData(Row, this); break; } case 2: { Data = new LocaleData(Row, this); break; } case 3: { Data = new ResourceData(Row, this); break; } case 4: { Data = new CharacterData(Row, this); break; } case 6: { Data = new ProjectileData(Row, this); break; } case 7: { Data = new BuildingClassData(Row, this); break; } case 8: { Data = new ObstacleData(Row, this); break; } case 9: { Data = new EffectData(Row, this); break; } case 10: { Data = new ParticleEmitterData(Row, this); break; } case 11: { Data = new ExperienceLevelData(Row, this); break; } case 12: { Data = new TrapData(Row, this); break; } case 13: { Data = new AllianceBadgeData(Row, this); break; } case 14: { Data = new GlobalData(Row, this); break; } case 15: { Data = new TownhallLevelData(Row, this); break; } case 16: { Data = new AlliancePortalData(Row, this); break; } case 17: { Data = new NpcData(Row, this); break; } case 18: { Data = new DecoData(Row, this); break; } case 19: { Data = new ResourcePackData(Row, this); break; } case 20: { Data = new ShieldData(Row, this); break; } case 21: { Data = new MissionData(Row, this); break; } case 22: { Data = new BillingPackageData(Row, this); break; } case 23: { Data = new AchievementData(Row, this); break; } case 25: { Data = new FaqData(Row, this); break; } case 26: { Data = new SpellData(Row, this); break; } case 27: { Data = new HintData(Row, this); break; } case 28: { Data = new HeroData(Row, this); break; } case 29: { Data = new LeagueData(Row, this); break; } case 30: { Data = new NewData(Row, this); break; } case 34: { Data = new AllianceBadgeLayerData(Row, this); break; } case 37: { Data = new VariableData(Row, this); break; } case 38: { Data = new GemBundleData(Row, this); break; } case 39: { Data = new VillageObjectData(Row, this); break; } default: { Data = new Data(Row, this); break; } } return(Data); }
internal Data Create(Row _Row) { Data _Data; switch ((Gamefile)this.Index) { case Gamefile.Buildings: _Data = new BuildingData(_Row, this); break; case Gamefile.Locales: _Data = new LocaleData(_Row, this); break; case Gamefile.Resources: _Data = new ResourceData(_Row, this); break; case Gamefile.Characters: _Data = new CharacterData(_Row, this); break; case Gamefile.Building_Classes: _Data = new BuildingClassData(_Row, this); break; case Gamefile.Obstacles: _Data = new ObstacleData(_Row, this); break; case Gamefile.Traps: _Data = new TrapData(_Row, this); break; case Gamefile.Globals: _Data = new GlobalData(_Row, this); break; case Gamefile.Experience_Levels: _Data = new ExperienceLevelData(_Row, this); break; case Gamefile.Townhall_Levels: _Data = new TownhallLevelData(_Row, this); break; case Gamefile.Npcs: _Data = new NpcData(_Row, this); break; case Gamefile.Decos: _Data = new DecoData(_Row, this); break; case Gamefile.Shields: _Data = new ShieldData(_Row, this); break; case Gamefile.Missions: _Data = new MissionData(_Row, this); break; case Gamefile.Achievements: _Data = new AchievementData(_Row, this); break; case Gamefile.Spells: _Data = new SpellData(_Row, this); break; case Gamefile.Heroes: _Data = new HeroData(_Row, this); break; case Gamefile.Leagues: _Data = new LeagueData(_Row, this); break; case Gamefile.Regions: _Data = new RegionData(_Row, this); break; case Gamefile.AllianceBadgeLayer: _Data = new AllianceBadgeLayerData(_Row, this); break; case Gamefile.Variables: _Data = new VariableData(_Row, this); break; case Gamefile.Village_Objects: _Data = new VillageObjectData(_Row, this); break; default: _Data = new Data(_Row, this); break; } return(_Data); }
/// <summary> /// Creates the data for the specified row. /// </summary> /// <param name="Row">The row.</param> internal Data Create(Row Row) { Data Data; switch (this.Index) { case 0: { Data = new BuildingData(Row, this); break; } case 1: { Data = new LocaleData(Row, this); break; } case 2: { Data = new ResourceData(Row, this); break; } case 3: { Data = new CharacterData(Row, this); break; } case 6: { Data = new BuildingClassData(Row, this); break; } case 7: { Data = new ObstacleData(Row, this); break; } case 8: { Data = new EffectData(Row, this); break; } case 9: { Data = new ParticleEmitterData(Row, this); break; } case 10: { Data = new ExperienceLevelData(Row, this); break; } case 11: { Data = new TrapData(Row, this); break; } case 12: { Data = new AllianceBadgeData(Row, this); break; } case 13: { Data = new GlobalData(Row, this); break; } case 14: { Data = new TownhallLevelData(Row, this); break; } case 15: { Data = new PrototypeData(Row, this); break; } case 16: { Data = new NpcData(Row, this); break; } case 17: { Data = new DecoData(Row, this); break; } case 18: { Data = new ResourcePackData(Row, this); break; } case 20: { Data = new MissionData(Row, this); break; } case 21: { Data = new BillingPackageData(Row, this); break; } case 22: { Data = new AchievementData(Row, this); break; } case 25: { Data = new SpellData(Row, this); break; } case 26: { Data = new HintData(Row, this); break; } case 27: { Data = new LandingShipData(Row, this); break; } case 28: { Data = new ArtifactData(Row, this); break; } case 29: { Data = new ArtifactBonusData(Row, this); break; } case 30: { Data = new DeepseaParameterData(Row, this); break; } case 31: { Data = new ExplorationCostData(Row, this); break; } case 34: { Data = new ResourceShipData(Row, this); break; } case 35: { Data = new LootBoxData(Row, this); break; } case 36: { Data = new LiberatedIncomeData(Row, this); break; } case 37: { Data = new RegionData(Row, this); break; } case 38: { Data = new DefenseRewardData(Row, this); break; } case 39: { Data = new LocatorData(Row, this); break; } case 40: { Data = new EventData(Row, this); break; } case 41: { Data = new FootstepData(Row, this); break; } case 42: { Data = new PersistentEventRewardData(Row, this); break; } case 43: { Data = new CommunityLinkData(Row, this); break; } case 44: { Data = new ShieldData(Row, this); break; } case 45: { Data = new AbTestData(Row, this); break; } case 46: { Data = new LetterData(Row, this); break; } case 47: { Data = new RankData(Row, this); break; } case 48: { Data = new CountryData(Row, this); break; } case 51: { Data = new BoomboxData(Row, this); break; } case 52: { Data = new HeroData(Row, this); break; } case 53: { Data = new HeroAbilityData(Row, this); break; } case 54: { Data = new OfferData(Row, this); break; } case 55: { Data = new DeepLinkData(Row, this); break; } case 56: { Data = new SectorData(Row, this); break; } case 57: { Data = new SectorBonusData(Row, this); break; } default: { Data = new Data(Row, this); break; } } return(Data); }