ItemIndexEntry CreateIndexEntry(EntityClassDefinition entity) { foreach (var match in matchers) { if (match.Matcher(entity)) { var classification = match.Classifier(entity.Components?.SAttachableComponentParams?.AttachDef.Type, entity.Components?.SAttachableComponentParams.AttachDef.SubType); var indexEntry = new ItemIndexEntry { className = entity.ClassName, reference = entity.__ref, itemName = entity.ClassName.ToLower(), type = entity.Components?.SAttachableComponentParams?.AttachDef.Type, subType = entity.Components?.SAttachableComponentParams?.AttachDef.SubType, size = entity.Components?.SAttachableComponentParams?.AttachDef.Size, grade = entity.Components?.SAttachableComponentParams?.AttachDef.Grade, name = entity.Components?.SAttachableComponentParams?.AttachDef.Localization.Name, tags = entity.Components?.SAttachableComponentParams?.AttachDef.Tags, manufacturer = FindManufacturer(entity.Components?.SAttachableComponentParams?.AttachDef.Manufacturer)?.code, classification = classification }; return(indexEntry); } } throw new ApplicationException("Item didn't get picked up by the default match for some reason"); }
ItemIndexEntry CreateIndexEntry(EntityClassDefinition entity) { var classification = itemClassifier.Classify(entity); var indexEntry = new ItemIndexEntry { className = entity.ClassName, reference = entity.__ref, itemName = entity.ClassName.ToLower(), type = entity.Components?.SAttachableComponentParams?.AttachDef.Type, subType = entity.Components?.SAttachableComponentParams?.AttachDef.SubType, size = entity.Components?.SAttachableComponentParams?.AttachDef.Size, grade = entity.Components?.SAttachableComponentParams?.AttachDef.Grade, name = entity.Components?.SAttachableComponentParams?.AttachDef.Localization.Name, tags = entity.Components?.SAttachableComponentParams?.AttachDef.Tags, manufacturer = manufacturerSvc.GetManufacturer(entity.Components?.SAttachableComponentParams?.AttachDef.Manufacturer, entity.ClassName)?.Code, classification = classification }; return(indexEntry); }