Esempio n. 1
0
 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]);
 }
Esempio n. 2
0
 void obtainfactions()
 {
     EsfLibrary.ParentNode factionarraynode =
         rootNode.GetNodeByPath(GameInfo.factionarraypath) as EsfLibrary.ParentNode;
     factions = new Factions(factionarraynode);
     this.setExisting(factions);
 }
Esempio n. 3
0
            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);
                    }
                });
            }
Esempio n. 4
0
 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));
     });
 }
Esempio n. 5
0
 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);
 }
Esempio n. 6
0
 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);
 }
Esempio n. 7
0
 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));
         }
     });
 }
Esempio n. 8
0
 public Faction(EsfLibrary.ParentNode node) : base(node)
 {
     try
     {
         obtainfactioncharacters();
         obtainfactionarmies();
     }
     catch
     {
         Console.WriteLine("faction creation fail at " + node.Values[name]);
     }
 }
Esempio n. 9
0
            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));
            }
Esempio n. 10
0
 public Armies(EsfLibrary.ParentNode node) : base(node)
 {
 }
Esempio n. 11
0
 public Characters(EsfLibrary.ParentNode node) : base(node)
 {
 }
Esempio n. 12
0
 public Ancillaries(EsfLibrary.ParentNode node) : base(node)
 {
 }
Esempio n. 13
0
 public Factions(EsfLibrary.ParentNode node) : base(node)
 {
 }
Esempio n. 14
0
 bool checksave()
 {
     EsfLibrary.ParentNode gamebuildnode = (EsfLibrary.ParentNode)rootNode.GetNodeByPath(GameInfo.gamebuildpath);
     return(gamebuildnode.Values[0].ToString().Contains(GameInfo.setting.gameName));
 }
Esempio n. 15
0
 public Skill(EsfLibrary.ParentNode node) : base(node)
 {
 }
Esempio n. 16
0
 public BaseGameItem(EsfLibrary.ParentNode node)
 {
     this.node = node;
 }
Esempio n. 17
0
 public ATWCharacter(EsfLibrary.ParentNode charnode)
     : base(charnode)
 {
 }
Esempio n. 18
0
 public Unit(EsfLibrary.ParentNode node) : base(node)
 {
 }
Esempio n. 19
0
 public BaseGameItemCollection(EsfLibrary.ParentNode node)
 {
     this.node = node;
     initialise(null);
 }