DefinitionDatabase IDefinitionsTransport.ReadDefinitions() { var db = new DefinitionDatabase(); using (var stream = this.GetType().Assembly.GetManifestResourceStream(_path)) { var definitions = XDocument.Load(stream).Element("Definitions"); db.AddRange(definitions.Elements("Definition").Select(ReadDefinition)); } return(db); }
internal Definition GetDefinition(int opcode) { if (Definitions == null) { Definitions = _transport.ReadDefinitions(); } var definition = Definitions.Get(opcode); if (definition != null) { return(definition); } throw new Exception(string.Format("No definition found for opcode {0}", opcode)); }