Exemple #1
0
 public void AddSecondaryReader(D2oReader dReader)
 {
     foreach (var @class in Classes)
     {
         Console.WriteLine(@class.Value.Name);
     }
     this.classcount    += dReader.classcount;
     this.headeroffset  += dReader.headeroffset;
     this.indextablelen += dReader.indextablelen;
     this.objectCreators.AddRange(dReader.objectCreators);
     foreach (var @class in dReader.Classes)
     {
         if (!this.Classes.ContainsKey(@class.Key)) // We don't have to worry about the class definitions that already exists.
         {
             this.Classes.Add(@class.Key, @class.Value);
         }
     }
     foreach (var pair in dReader.Indexes)
     {
         if (pair.Key == 17683)
         {
             Console.WriteLine("");
         }
         if (!this.Indexes.ContainsKey(pair.Key))
         {
             this.Indexes.Add(pair.Key, pair.Value);
         }
     }
 }
Exemple #2
0
 public void AddReaders(string directory)
 {
     foreach (var D2oFile in Directory.EnumerateFiles(directory).Where(entry => entry.EndsWith(".d2o")))
     {
         var reader = new D2oReader(D2oFile);
         AddReader(reader);
     }
 }
Exemple #3
0
        private void ResetMembersByReading()
        {
            var reader = new D2oReader(File.OpenRead(Filename));

            indexTable       = reader.Indexes;
            classes          = reader.Classes;
            allocatedClassId = classes.ToDictionary(entry => entry.Value.ClassType, entry => entry.Key);
            objects          = reader.ReadObjects();

            reader.Close();
        }
Exemple #4
0
        private void AddReader(D2oReader D2oFile)
        {
            var classes = D2oFile.Classes;

            foreach (var @class in classes)
            {
                //if (ignoredTypes.Contains(@class.Value.ClassType))
                //continue;

                // readers exists then we justa add then to the list of readers. If not then new List
                if (readers.ContainsKey(@class.Value.ClassType))
                {
                    readers[@class.Value.ClassType].Add(D2oFile);
                }
                else
                {
                    var tmp = new List <D2oReader>();
                    tmp.Add(D2oFile);
                    readers.Add(@class.Value.ClassType, tmp);
                }
            }
        }
        private void AddReader(D2oReader D2oFile)
        {
            var classes = D2oFile.Classes;

            foreach (var @class in classes)
            {
                if (ignoredTypes.Contains(@class.Value.ClassType))
                {
                    continue;
                }

                if (readers.ContainsKey(@class.Value.ClassType))
                {
                    // this classes are not bound to a single file, so we ignore them
                    ignoredTypes.Add(@class.Value.ClassType);
                    readers.Remove(@class.Value.ClassType);
                }
                else
                {
                    readers.Add(@class.Value.ClassType, D2oFile);
                }
            }
        }