C#
public class Ideology
{
public string name { get; set; }
public string color { get; set; }
private List<SubIdeology> subideologiesl;
private List<string> dynamic_faction_names;
private List<NameValue> rules;
private List<NameValue> modifiers;
public bool can_collaborate { get; set; }
public bool ai_fascist { get; set; }
public double war_impact_on_world_tension { get; set; }
public double faction_impact_on_world_tension { get; set; }
public double ai_ideology_wanted_units_factor { get; set; }
public Ideology(string _name)
{
dynamic_faction_names = new List<string>();
rules = new List<NameValue>();
modifiers = new List<NameValue>();
subideologiesl = new List<SubIdeology>();
name = _name;
}
public void AddFactionName(string name)
{
dynamic_faction_names.Add(name);
}
public void AddRule(string name, string value)
{
rules.Add(new NameValue(name, value));
}
public void AddModifier(string name, string value)
{
modifiers.Add(new NameValue(name, value));
}
public void AddSubIdeology(SubIdeology subIdeology)
{
subideologiesl.Add(subIdeology);
}
}
public struct NameValue
{
public string name;
public string value;
public NameValue(string name, string value) { this.name = name; this.value = value; }
}
public struct SubIdeology
{
public string name;
public bool can_be_randomly_selected;
public List<NameValue> modifiers;
public SubIdeology(string name) { this.name = name; }
}