Exemple #1
0
    public static IEnumerator LoadConfig(XmlNode seedsXml, MissionConfig missionConfig)
    {
        XmlNode    peopleNode = seedsXml.SelectSingleNode("people");
        List <int> people     = Misc.splitInts(peopleNode.InnerText);

        XmlNode    bagsNode = seedsXml.SelectSingleNode("bags");
        List <int> bags     = Misc.splitInts(bagsNode.InnerText);

        SeedsConfig seedsConfig = new SeedsConfig(people, bags);

        missionConfig.seedsConfig = seedsConfig;

        yield return(null);
    }
Exemple #2
0
    public static IEnumerator LoadConfig(XmlNode missionXml)
    {
        XmlAttributeCollection missionAttributes = missionXml.Attributes;
        String id          = Misc.xmlString(missionAttributes.GetNamedItem("id"));
        String name        = Misc.xmlString(missionAttributes.GetNamedItem("name"));
        String description = Misc.xmlString(missionAttributes.GetNamedItem("description"));
        String location    = Misc.xmlString(missionAttributes.GetNamedItem("location"));
        String icon        = Misc.xmlString(missionAttributes.GetNamedItem("icon"));

        String startTime     = Misc.xmlString(missionAttributes.GetNamedItem("startTime"));
        String endTime       = Misc.xmlString(missionAttributes.GetNamedItem("endTime"));
        String overtime      = Misc.xmlString(missionAttributes.GetNamedItem("overtime"));
        int    timeSpeed     = Misc.xmlInt(missionAttributes.GetNamedItem("timeSpeed"), 1);
        String clockType     = Misc.xmlString(missionAttributes.GetNamedItem("clockType"));
        int    clockPosition = Misc.xmlInt(missionAttributes.GetNamedItem("clockPosition"), 0);

        String difficulty = Misc.xmlString(missionAttributes.GetNamedItem("difficulty"));
        String stars3     = Misc.xmlString(missionAttributes.GetNamedItem("stars3"));
        String stars2     = Misc.xmlString(missionAttributes.GetNamedItem("stars2"));
        String stars1     = Misc.xmlString(missionAttributes.GetNamedItem("stars1"));

        String failCondition = Misc.xmlString(missionAttributes.GetNamedItem("failCondition"));

        MissionConfig missionConfig = new MissionConfig(id, name, description, location,
                                                        icon, startTime, endTime, overtime, timeSpeed,
                                                        clockType, clockPosition, difficulty, stars3,
                                                        stars2, stars1, failCondition);

        XmlNode seeds = missionXml.SelectSingleNode("seeds");

        yield return(SeedsConfig.LoadConfig(seeds, missionConfig));

        XmlNode encounters = missionXml.SelectSingleNode("encounters");

        yield return(EncountersConfig.LoadConfig(encounters, missionConfig));

        Debug.Log("Mission loaded:");
        Debug.Log("Location: " + missionConfig.location + " " + missionConfig.startTime + " (" + missionConfig.clockType + ", " + missionConfig.clockPosition + ")");
        Debug.Log("Seeds: " + missionConfig.seedsConfig.bags.Count + " " + missionConfig.seedsConfig.people.Count);
        Debug.Log("Encounters: " + missionConfig.encountersConfig.people.Count);

        Instance = missionConfig;
    }
Exemple #3
0
 public SeedTool(SeedsConfig config)
 {
     _config = config;
 }
 /*********
 ** Public methods
 *********/
 /// <summary>Construct an instance.</summary>
 /// <param name="config">The attachment settings.</param>
 public SeedAttachment(SeedsConfig config)
 {
     this.Config = config;
 }
Exemple #5
0
 /*********
 ** Public methods
 *********/
 /// <summary>Construct an instance.</summary>
 /// <param name="config">The attachment settings.</param>
 /// <param name="reflection">Simplifies access to private code.</param>
 public SeedAttachment(SeedsConfig config, IReflectionHelper reflection)
     : base(reflection)
 {
     this.Config = config;
 }
Exemple #6
0
 public SeedTool(SeedsConfig config)
 {
     this.Config = config;
 }