public void AddReaders(string directory) { foreach (var D2oFile in Directory.EnumerateFiles(directory).Where(entry => entry.EndsWith(".d2o"))) { var reader = new D2oReader(D2oFile); AddReader(reader); } }
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(); }
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); } } }