// Load config file of planets to add, 1 per line (planet type, row, column) public List <Tuple <SpaceDestinationType, int, int> > LoadConfig() { // List to hold planets List <Tuple <SpaceDestinationType, int, int> > planets = new List <Tuple <SpaceDestinationType, int, int> >(); // Create path to the config file string fileName = Path.Combine(this.path, "config.txt"); // Read all the lines if (File.Exists(fileName)) { string[] lines = File.ReadAllLines(fileName, Encoding.UTF8); // Get the list of destination types for converting the text names from the config SpaceDestinationTypes spaceDestinationTypes = Db.Get().SpaceDestinationTypes; // Copy in each planet to add, 1 per line in format (type, row) foreach (string line in lines) { // Split around comma string[] parts = line.Split(','); // Convert the text and get the type SpaceDestinationType spaceDestinationType = convertSpaceDestinationType(spaceDestinationTypes, parts[0]); // Add the type and the row number planets.Add(new Tuple <SpaceDestinationType, int, int>(spaceDestinationType, int.Parse(parts[1]), int.Parse(parts[2]))); } } return(planets); }
public override void Initialize() { base.Initialize(); Urges = new Urges(); AssignableSlots = new AssignableSlots(); StateMachineCategories = new StateMachineCategories(); Personalities = new Personalities(); Faces = new Faces(); Shirts = new Shirts(); Expressions = new Expressions(Root); Thoughts = new Thoughts(Root); Deaths = new Deaths(Root); StatusItemCategories = new StatusItemCategories(Root); Techs = new Techs(Root); Techs.Load(researchTreeFile); TechTreeTitles = new TechTreeTitles(Root); TechTreeTitles.Load(researchTreeFile); TechItems = new TechItems(Root); Accessories = new Accessories(Root); AccessorySlots = new AccessorySlots(Root, null, null, null); ScheduleBlockTypes = new ScheduleBlockTypes(Root); ScheduleGroups = new ScheduleGroups(Root); RoomTypeCategories = new RoomTypeCategories(Root); RoomTypes = new RoomTypes(Root); ArtifactDropRates = new ArtifactDropRates(Root); SpaceDestinationTypes = new SpaceDestinationTypes(Root); Diseases = new Diseases(Root); Sicknesses = new Database.Sicknesses(Root); SkillPerks = new SkillPerks(Root); SkillGroups = new SkillGroups(Root); Skills = new Skills(Root); ColonyAchievements = new ColonyAchievements(Root); MiscStatusItems = new MiscStatusItems(Root); CreatureStatusItems = new CreatureStatusItems(Root); BuildingStatusItems = new BuildingStatusItems(Root); ChoreTypes = new ChoreTypes(Root); Effect effect = new Effect("CenterOfAttention", DUPLICANTS.MODIFIERS.CENTEROFATTENTION.NAME, DUPLICANTS.MODIFIERS.CENTEROFATTENTION.TOOLTIP, 0f, true, true, false, null, 0f, null); effect.Add(new AttributeModifier("StressDelta", -0.008333334f, DUPLICANTS.MODIFIERS.CENTEROFATTENTION.NAME, false, false, true)); effects.Add(effect); CollectResources(Root, ResourceTable); }
// Converts text names of planets to their types private static SpaceDestinationType convertSpaceDestinationType(SpaceDestinationTypes spaceDestinationTypes, String destinationType) { SpaceDestinationType spaceDestinationType = null; switch (destinationType) { case "Satellite": spaceDestinationType = spaceDestinationTypes.Satellite; break; case "MetallicAsteroid": spaceDestinationType = spaceDestinationTypes.MetallicAsteroid; break; case "RockyAsteroid": spaceDestinationType = spaceDestinationTypes.RockyAsteroid; break; case "CarbonaceousAsteroid": spaceDestinationType = spaceDestinationTypes.CarbonaceousAsteroid; break; case "IcyDwarf": spaceDestinationType = spaceDestinationTypes.IcyDwarf; break; case "OrganicDwarf": spaceDestinationType = spaceDestinationTypes.OrganicDwarf; break; case "TerraPlanet": spaceDestinationType = spaceDestinationTypes.TerraPlanet; break; case "VolcanoPlanet": spaceDestinationType = spaceDestinationTypes.VolcanoPlanet; break; case "GasGiant": spaceDestinationType = spaceDestinationTypes.GasGiant; break; case "IceGiant": spaceDestinationType = spaceDestinationTypes.IceGiant; break; case "DustyDwarf": spaceDestinationType = spaceDestinationTypes.DustyMoon; break; case "Wormhole": spaceDestinationType = spaceDestinationTypes.Wormhole; break; case "SaltDwarf": spaceDestinationType = spaceDestinationTypes.SaltDwarf; break; case "RustPlanet": spaceDestinationType = spaceDestinationTypes.RustPlanet; break; case "ForestPlanet": spaceDestinationType = spaceDestinationTypes.ForestPlanet; break; case "RedDwarf": spaceDestinationType = spaceDestinationTypes.RedDwarf; break; case "GoldAsteroid": spaceDestinationType = spaceDestinationTypes.GoldAsteroid; break; case "HydrogenGiant": spaceDestinationType = spaceDestinationTypes.HydrogenGiant; break; case "OilyAsteroid": spaceDestinationType = spaceDestinationTypes.OilyAsteroid; break; case "ShinyPlanet": spaceDestinationType = spaceDestinationTypes.ShinyPlanet; break; case "ChlorinePlanet": spaceDestinationType = spaceDestinationTypes.ChlorinePlanet; break; case "SaltDesertPlanet": spaceDestinationType = spaceDestinationTypes.SaltDesertPlanet; break; case "Earth": spaceDestinationType = spaceDestinationTypes.Earth; break; } return(spaceDestinationType); }
public static List <List <string> > GetDestinationList() { SpaceDestinationTypes spaceDestinationTypes = Db.Get().SpaceDestinationTypes; return(((MySpaceDestinationTypes)spaceDestinationTypes).GetDestinationPools()); }