public void report(int worldId) { if (judgeLevelUpped()) { TOWN.levelUped(); } if (judgeSizeUpped()) { TOWN.sizeUped(); } var keys = charactersTraded.Keys; foreach (IFriendly character in keys) { if (judgeLevelUpped()) { if (character is Merchant) { var merchant = (Merchant)character; merchant.levelup(); } if (character is Client) { var client = (Client)character; client.levelup(); } } } ObserverHelper.saveToFile <TownBuilder>(TOWN.compressIntoBuilder(), "TownData", townId, worldId); }
public override void report(int worldId) { this.healItem = HealItemMasterManager.getInstance().getHealItemBuilderFromId(OBSERVE_ITEM_ID); HealItemProgress progress = HealItemMasterManager.getInstance().getProgress(OBSERVE_ITEM_ID); progress.Heal += reportHealValue(); progress.Level = reportItemLevel(progress.Heal); ObserverHelper.saveToFile <HealItemProgress>(progress, "HealItemProgress", OBSERVE_ITEM_ID, worldId); }
public override void report(int worldId) { material = ItemMaterialMasterManager.getInstance().getMaterialBuilderFromId(OBSERVE_ITEM_ID); ItemMaterialProgress progress = ItemMaterialMasterManager.getInstance().getProgress(OBSERVE_ITEM_ID); progress.Quality += progressQuality(); progress.Level = progressLevel(progress.Quality); ObserverHelper.saveToFile <ItemMaterialProgress>(progress, "ItemMaterialProgress", OBSERVE_ITEM_ID, worldId); }
public void saveWorld() { var saveData = new WorldData(); saveData.Towns = this.towns; saveData.WorldLevel = this.worldLevel; saveData.WorldName = this.worldName; ObserverHelper.saveToFile <WorldData>(saveData, "WorldData", id, id); foreach (Town town in enableTowns) { var builder = town.compressIntoBuilder(); ObserverHelper.saveToFile <TownBuilder>(builder, "TownData", town.getId(), id); MonoBehaviour.Destroy(town.gameObject); } }
public void report(int worldId) { progress.Effect += getValueProgress(Effect); progress.Cost -= getValueProgress(Cost); progress.Delay -= getSpeedProgress(Delay); if (IsAttackSkill) { var attackProgress = (ActiveAttackSkillProgress)progress; attackProgress.Hit += Hit; ObserverHelper.saveToFile <ActiveAttackSkillProgress>(attackProgress, FileAddress, OBSERVE_SKILL_ID, worldId); } else { ObserverHelper.saveToFile <ActiveSkillProgress>(progress, FileAddress, OBSERVE_SKILL_ID, worldId); } }
public void report(int worldId) { observeEnemyBuilder = EnemyMasterManager.getInstance().getEnemyBuilderFromId(OBSERVE_ENEMY_ID); var abilities = new Dictionary <BattleAbility, int>(); var keys = Enum.GetValues(typeof(BattleAbility)); foreach (BattleAbility ability in keys) { if (ability == MFT || ability == FFT || ability == MGP) { if (judgeAttackAbilityProgressed()) { abilities.Add(ability, progressAttackAbility()); } else { abilities.Add(ability, 0); } } else { if (judgeExserciseAbilityProgressed()) { abilities.Add(ability, progressExserciseAbility()); } else { abilities.Add(ability, 0); } } } var attributeTable = new Dictionary <AttackSkillAttribute, float>(); var attributeKeys = Enum.GetValues(typeof(AttackSkillAttribute)); foreach (AttackSkillAttribute attribute in attributeKeys) { if (judgeResistanceProsessed(attribute)) { attributeTable.Add(attribute, progressResistance(attribute)); } else { attributeTable.Add(attribute, 0); } } int weponLevel; if (judgeWeponLevelUped()) { weponLevel = weponLevelUp(); } else { weponLevel = 0; } var progress = EnemyMasterManager.getInstance().getProgressFromId(OBSERVE_ENEMY_ID); var abilityKeys = abilities.Keys; foreach (var key in abilityKeys) { progress.Abilities[key] += abilities[key]; } foreach (AttackSkillAttribute key in attributeKeys) { progress.AttributeResistances[key] += attributeTable[key]; } progress.WeponLevel += weponLevel; ObserverHelper.saveToFile <EnemyProgress>(progress, "EnemyProgress", OBSERVE_ENEMY_ID, worldId); }