Exemplo n.º 1
0
 internal SettlementGenerator()
 {
     npcGenerator = new NPCRandomizer.Generator("npc_names.json", "races.json", "nations.json");
     cities       = ConfigurationLoader.GetConfiguration <CityData>("data/city_data.json");
     items        = ConfigurationLoader.GetConfiguration <ItemData>("data/itemRanks.json");
     settlements  = ConfigurationLoader.GetConfiguration <SettlementData>("data/settlementTypes.json");
     roles        = ConfigurationLoader.GetConfiguration <SettlementRole>("data/settlementRoles.json");
 }
        public List <NPCRandomizer.PersonData> GetNPCs(CityData city, NPCRandomizer.Generator gen)
        {
            var nation = new NPCRandomizer.NationData()
            {
                Name = city.Nation, Races = city.Races
            };
            var output = new List <NPCRandomizer.PersonData>();

            foreach (var prof in NPCs)
            {
                var npc = gen.GenerateNPCforCity(nation);
                npc.Profession = prof;
                output.Add(npc);
            }
            return(output);
        }