public static SavedVaultPath ConvertFrom(VaultPath path) { var output = new SavedVaultPath(); foreach (var room in path.rooms) { output.roomIds.Add(room.uuid); } return(output); }
public static SavedDungeon ConvertFrom(OverworldDungeon dungeon) { if (dungeon.dungeonData == null) { return new SavedDungeon() { location = SavedVector2.ConvertFrom(dungeon.position), uuid = dungeon.uuid } } ; var output = new SavedDungeon { entered = true, location = SavedVector2.ConvertFrom(dungeon.position), numFloors = dungeon.dungeonData.numFloors, grid = dungeon.dungeonData.grid, maxSocialTier = dungeon.dungeonData.maxSocialTier, maxDimensions = dungeon.dungeonData.maxDimensions, encounterThemes = dungeon.dungeonData.encounterThemes, seeds = dungeon.seeds, uuid = dungeon.uuid, lootSlotAffinities = dungeon.dungeonData.lootSlotAffinities, lootPrimaryStatAffinities = dungeon.dungeonData.lootPrimaryStatAffinities, lootSecondaryStatAffinities = dungeon.dungeonData.lootSecondaryStatAffinities, elementalAffinity = dungeon.dungeonData.elementalAffinity, bossLootSlotAffinities = dungeon.dungeonData.bossLootSlotAffinities }; foreach (var kvp in dungeon.dungeonData.enemyStatBoosts) { output.enemyStatBoostEnemies.Add(kvp.Key); output.enemyStatBoostStats.Add(kvp.Value); } foreach (var kvp in dungeon.dungeonData.enemyBonusAbilities) { output.enemyBonusAbilityEnemies.Add(kvp.Key); output.enemyBonusAbilityAbilities.Add(SavedActiveAbility.ConvertFrom(kvp.Value)); } foreach (var room in dungeon.dungeonData.rooms) { output.rooms.Add(SavedRoom.ConvertFrom(room)); } foreach (var monster in dungeon.dungeonData.monsters) { output.monsters.Add(SavedMonsterData.ConvertFrom(monster)); } foreach (var path in dungeon.dungeonData.paths) { output.paths.Add(SavedVaultPath.ConvertFrom(path)); } return(output); }