public Army(EsfLibrary.ParentNode armynode) : base(armynode) { skills = new BaseGameItemCollection(typeof(Skill), (EsfLibrary.ParentNode)node.Children[0].Children[0].Children[0]); units = new BaseGameItemCollection(typeof(Unit), (EsfLibrary.ParentNode)node.Children[1].Children[0]); }
void obtainfactions() { EsfLibrary.ParentNode factionarraynode = rootNode.GetNodeByPath(GameInfo.factionarraypath) as EsfLibrary.ParentNode; factions = new Factions(factionarraynode); this.setExisting(factions); }
protected override void initialise(Type type) { Action <EsfLibrary.ParentNode> new_character; switch (GameInfo.GetGameVersion()) { case "ATW": new_character = new Action <EsfLibrary.ParentNode>((chardetailsnode) => Add(new ATWCharacter(chardetailsnode))); break; default: new_character = new Action <EsfLibrary.ParentNode>((chardetailsnode) => Add(new Character(chardetailsnode))); break; } Parallel.ForEach(node.Children, (characternode) => { EsfLibrary.ParentNode chardetailsnode = characternode.Children[0].Children[1]; string cclass = chardetailsnode.Values[GameInfo.setting.character_class_path].ToString(); if (cclass != "colonel") { new_character.Invoke(chardetailsnode); } }); }
protected override void initialise(Type type) { Parallel.ForEach(node.Children, faction_node_upper => { EsfLibrary.ParentNode faction_node = faction_node_upper.Children[0]; Add(new Faction(faction_node)); }); }
public BaseGameItemCollection(Type type, EsfLibrary.ParentNode node) { if (!type.IsSubclassOf(typeof(BaseGameItem))) { throw new ArgumentException(string.Format("Invalid type {0}", type)); } this.node = node; initialise(type); }
public Character(EsfLibrary.ParentNode charnode) : base(charnode) { traits = new BaseGameItemCollection(typeof(Trait), (EsfLibrary.ParentNode)node.GetNodeByPath(GameInfo.charactertraitpath)); skills = new BaseGameItemCollection(typeof(Skill), (EsfLibrary.ParentNode)node.GetNodeByPath(GameInfo.characterskillpath)); ancillaries = new Ancillaries(node); }
protected override void initialise(Type type) { Parallel.ForEach(node.Children, (armynode) => { EsfLibrary.ParentNode militaryforce = armynode.Children[0]; string cclass = militaryforce.GetNodeByPath((string)GameInfo.setting.army_class).ToString(); if (cclass.Equals("0") || cclass.Equals("1")) { Add(new Army(militaryforce)); } }); }
public Faction(EsfLibrary.ParentNode node) : base(node) { try { obtainfactioncharacters(); obtainfactionarmies(); } catch { Console.WriteLine("faction creation fail at " + node.Values[name]); } }
public override string ToString() { EsfLibrary.ParentNode characternamenode = (EsfLibrary.ParentNode)node.GetNodeByPath(GameInfo.characternamepath); List <string> characternames = new List <string>(4); foreach (EsfLibrary.ParentNode characternameblock in characternamenode.Children) { EsfLibrary.ParentNode namenode = characternameblock.Children[0]; string tempname = namenode.Values[0].ToString(); if (tempname != "") { if (GameData.GetInstance().DictionaryCharacterName.ContainsKey(tempname)) { tempname = GameData.GetInstance().DictionaryCharacterName[tempname]; } characternames.Add(tempname); } } return(string.Join(" ", characternames)); }
public Armies(EsfLibrary.ParentNode node) : base(node) { }
public Characters(EsfLibrary.ParentNode node) : base(node) { }
public Ancillaries(EsfLibrary.ParentNode node) : base(node) { }
public Factions(EsfLibrary.ParentNode node) : base(node) { }
bool checksave() { EsfLibrary.ParentNode gamebuildnode = (EsfLibrary.ParentNode)rootNode.GetNodeByPath(GameInfo.gamebuildpath); return(gamebuildnode.Values[0].ToString().Contains(GameInfo.setting.gameName)); }
public Skill(EsfLibrary.ParentNode node) : base(node) { }
public BaseGameItem(EsfLibrary.ParentNode node) { this.node = node; }
public ATWCharacter(EsfLibrary.ParentNode charnode) : base(charnode) { }
public Unit(EsfLibrary.ParentNode node) : base(node) { }
public BaseGameItemCollection(EsfLibrary.ParentNode node) { this.node = node; initialise(null); }