Exemple #1
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 #2
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 #3
0
        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);
                }
            }
        }