Exemple #1
0
 /// <summary>
 /// Deserialization constructor for root category only.
 /// </summary>
 /// <param name="src">Source Serializable Market Group</param>
 private MarketGroup(SerializableMarketGroup src)
 {
     ID        = src.ID;
     Name      = src.Name;
     SubGroups = new MarketGroupCollection(this, src.SubGroups);
     Items     = new ItemCollection(this, src.Items);
 }
Exemple #2
0
 /// <summary>
 /// Deserialization constructor for root category only
 /// </summary>
 /// <param name="src">Source Serializable Market Group</param>
 public MarketGroup(SerializableMarketGroup src)
 {
     m_id            = src.ID;
     m_name          = src.Name;
     m_subCategories = new MarketGroupCollection(this, src.SubGroups);
     m_items         = new ItemCollection(this, src.Items);
 }
Exemple #3
0
        /// <summary>
        /// Initialize static items.
        /// </summary>
        internal static void Load()
        {
            if (MarketGroups != null)
            {
                return;
            }

            // Create the implants slots
            for (int i = 0; i < s_implantSlots.Length; i++)
            {
                s_implantSlots[i] = new ImplantCollection((ImplantSlots)i);
            }

            // Deserialize the items datafile
            ItemsDatafile datafile = Util.DeserializeDatafile <ItemsDatafile>(DatafileConstants.ItemsDatafile,
                                                                              Util.LoadXslt(Properties.Resources.DatafilesXSLT));

            MarketGroups = new MarketGroupCollection(null, datafile.MarketGroups);

            // Gather the items into a by-ID dictionary
            foreach (MarketGroup marketGroup in MarketGroups)
            {
                InitializeDictionaries(marketGroup);
            }

            GlobalDatafileCollection.OnDatafileLoaded();
        }
Exemple #4
0
        /// <summary>
        /// Load the items from the datafile
        /// </summary>
        internal static void Load()
        {
            if (s_roots != null)
            {
                return;
            }

            // Create the implants slots
            for (int i = 0; i < s_implantSlots.Length; i++)
            {
                s_implantSlots[i] = new ImplantSlot((ImplantSlots)i);
                s_implantSlots[i].Add(new Implant());
            }

            // Deserialize the items datafile
            var datafile = Util.DeserializeDatafile <ItemsDatafiles>(DatafileConstants.ItemsDatafile);

            s_roots = new MarketGroupCollection(null, datafile.MarketGroups);

            // Gather the items into a by-ID dictionary.
            foreach (var group in s_roots)
            {
                InitializeDictionaries(group);
            }
        }