public static void NewGMData(string dynastyName, string yearName, string emperorName) { GMControll.Init(); Inist = new GMData(dynastyName, yearName, emperorName); Inist.Initializer(); isInited = true; }
public static void Load() { Debug.Log("Load:" + savePath); string json = File.ReadAllText(savePath + "/game.save"); JsonSerializer serializer = new JsonSerializer(); StringReader sr = new StringReader(json); GMControll.Init(); Inist = serializer.Deserialize(new JsonTextReader(sr), typeof(GMData)) as GMData; Inist.Initializer(); isInited = true; Debug.Log("GMData Load"); }
public void Init(GMData gmdata) { var persons = gmdata.persons.All; var offices = HuangDAPI.Office.All; var factions = HuangDAPI.Faction.All; for (int i = 0; i < Math.Min(persons.Length, offices.Length); i++) { office2person.Add(offices[i].name, persons[i].name); evtOffice2PersonChange(offices[i].name, persons[i].name); } for (int i = 0; i < persons.Length; i++) { int index = Tools.Probability.GetRandomNum(0, factions.Length); person2faction.Add(persons[i].name, factions[index].name); //evtPerson2FactionChange(factions[index].name, persons[i].name); } }