public UniqueBase(ItemImageService itemImageService, ItemBase itemBase, XmlUnique xmlUnique) { UniqueName = xmlUnique.Name; Level = xmlUnique.Level; DropDisabled = xmlUnique.DropDisabled; _base = itemBase; ExplicitMods = xmlUnique.Explicit.Select(e => new Stat(e, itemBase.ItemType)).ToList(); Image = itemBase.Image.AsDefaultForUniqueImage(itemImageService, UniqueName); }
public UniqueBase(ItemImageService itemImageService, ModDatabase modDatabase, ItemBase itemBase, XmlUnique xmlUnique) { UniqueName = xmlUnique.Name; Level = xmlUnique.Level; DropDisabled = xmlUnique.DropDisabled; _base = itemBase; _properties = xmlUnique.Properties; var explicits = new List <IMod>(); foreach (var id in xmlUnique.Explicit) { Mod mod; if (!modDatabase.Mods.TryGetValue(id, out mod)) { Log.Error($"Unknown mod id {id} on unique {UniqueName}"); continue; } explicits.Add(mod); } ExplicitMods = explicits; Image = itemBase.Image.AsDefaultForUniqueImage(itemImageService, UniqueName); }