Esempio n. 1
0
        public void OnPreLoad()
        {
            try
            {
                XmlDbData careerData = XmlDbData.ReadData("NRaas.StoryProgression.Retired");

                XmlDbData careerEventData = XmlDbData.ReadData("CareerEvents");

                if ((careerData != null) &&
                    (careerData.Tables != null) &&
                    (careerEventData != null) &&
                    (careerEventData.Tables != null) &&
                    (careerData.Tables.ContainsKey("CareerList")))
                {
                    XmlDbTable table = careerData.Tables["CareerList"];
                    foreach (XmlDbRow row in table.Rows)
                    {
                        string key = row.GetString("TableName");
                        if (key != "Retired")
                        {
                            continue;
                        }

                        if (careerData.Tables.ContainsKey(key))
                        {
                            XmlDbTable table2 = careerData.Tables[key];
                            if (table2 != null)
                            {
                                XmlDbTable table3 = null;
                                careerEventData.Tables.TryGetValue(key, out table3);

                                Career career = new Retired(row, table2, table3);

                                if ((career != null) && (career.Guid != OccupationNames.Undefined))
                                {
                                    if (!GenericManager <OccupationNames, Occupation, Occupation> .sDictionary.ContainsKey((ulong)career.Guid))
                                    {
                                        GenericManager <OccupationNames, Occupation, Occupation> .sDictionary.Add((ulong)career.Guid, career);
                                    }
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception exception)
            {
                Common.Exception("Retired PreLoad", exception);
            }
        }
Esempio n. 2
0
        public void OnPreLoad()
        {
            try
            {
                XmlDbData careerData = XmlDbData.ReadData("NRaas.StoryProgression.Retired");

                XmlDbData careerEventData = XmlDbData.ReadData("CareerEvents");

                if ((careerData != null) &&
                    (careerData.Tables != null) &&
                    (careerEventData != null) &&
                    (careerEventData.Tables != null) &&
                    (careerData.Tables.ContainsKey("CareerList")))
                {
                    XmlDbTable table = careerData.Tables["CareerList"];
                    foreach (XmlDbRow row in table.Rows)
                    {
                        string key = row.GetString("TableName");
                        if (key != "Retired") continue;

                        if (careerData.Tables.ContainsKey(key))
                        {
                            XmlDbTable table2 = careerData.Tables[key];
                            if (table2 != null)
                            {
                                XmlDbTable table3 = null;
                                careerEventData.Tables.TryGetValue(key, out table3);

                                Career career = new Retired(row, table2, table3);

                                if ((career != null) && (career.Guid != OccupationNames.Undefined))
                                {
                                    if (!GenericManager<OccupationNames, Occupation, Occupation>.sDictionary.ContainsKey((ulong)career.Guid))
                                    {
                                        GenericManager<OccupationNames, Occupation, Occupation>.sDictionary.Add((ulong)career.Guid, career);
                                    }
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception exception)
            {
                Common.Exception("Retired PreLoad", exception);
            }
        }