public HomelandGroup(IObjectStore data) { Homelands = new WeightedOptionTable <Homeland>(); Name = data.GetString("race"); var table = data.GetObjectList("table"); foreach (var entry in table) { var homeland = new Homeland(Name, entry); Homelands.AddEntry(homeland, homeland.Weighting); } }
private void ParseYaml(YamlNodeWrapper yaml) { homelands = new List <Homeland>(); foreach (var node in yaml.Children()) { var table = node.GetNode("table"); foreach (var entry in table.Children()) { var homeland = new Homeland(); homeland.Race = node.GetString("race"); homeland.Location = entry.GetString("location"); homeland.Weighting = entry.GetInteger("weight"); homeland.Traits.Add(entry.GetCommaStringOptional("traits")); homelands.Add(homeland); } } }