public ItemWrapper(ACDItem item) { ActorSNO = item.ActorSNO; GameBalanceId = item.GameBalanceId; DynamicID = item.DynamicId; ACDGuid = item.ACDGuid; InventorySlot = item.InventorySlot; ValidInventorySlots = item.ValidInventorySlots; RequiredLevel = item.RequiredLevel; IsUnidentified = item.IsUnidentified; IsTwoHand = item.IsTwoHand; IsOneHand = item.IsOneHand; Name = item.Name; InternalName = item.InternalName; this.ItemType = item.ItemType; this.ItemBaseType = item.ItemBaseType; IsShield = ShieldTypes.Contains(ItemType); IsOffHand = OffHandTypes.Contains(ItemType); IsArmor = ArmorTypes.Contains(ItemType); IsJewlery = JewleryTypes.Contains(ItemType); IsWeapon = WeaponTypes.Contains(ItemType); IsMisc = MiscTypes.Contains(ItemType); HasSingleUseSlot = IsSingleSlotItem(); Item = item; Stats = item.Stats; }
public ItemWrapper(ACDItem item) { try { ActorSNO = item.ActorSNO; GameBalanceId = item.GameBalanceId; DynamicId = item.DynamicId; ACDGuid = item.ACDGuid; InventorySlot = item.InventorySlot; ValidInventorySlots = item.ValidInventorySlots; RequiredLevel = item.RequiredLevel; } catch (Exception ex) { Logger.LogError("Error wrapping non-attribute properties on item {0}: " + ex); } try { Name = item.Name; IsUnidentified = item.IsUnidentified; IsTwoHand = item.IsTwoHand; IsOneHand = item.IsOneHand; InternalName = item.InternalName; ItemType = item.ItemType; ItemBaseType = item.ItemBaseType; IsShield = ShieldTypes.Contains(ItemType); IsOffHand = OffHandTypes.Contains(ItemType); IsArmor = ArmorTypes.Contains(ItemType); IsJewelry = JewleryTypes.Contains(ItemType); IsWeapon = WeaponTypes.Contains(ItemType); IsEquipment = item.ItemBaseType == ItemBaseType.Armor || item.ItemBaseType == ItemBaseType.Jewelry || item.ItemBaseType == ItemBaseType.Weapon; IsMisc = MiscTypes.Contains(ItemType); IsGem = item.ItemBaseType == ItemBaseType.Gem; IsTwoSquareItem = (item.ItemBaseType == ItemBaseType.Armor || item.ItemBaseType == ItemBaseType.Weapon) && item.IsTwoSquareItem; IsPotion = item.IsPotion; ItemQualityLevel = item.ItemQualityLevel; GemQuality = item.GemQuality; TieredLootRunKeyLevel = item.TieredLootRunKeyLevel; ItemStackQuantity = item.ItemStackQuantity; IsSetItem = item.IsSetItem(); ItemSetName = item.ItemSetName(); HasSingleUseSlot = IsSingleSlotItem(); Item = item; Stats = item.Stats; StatsData = ItemStatsDataFactory.GetItemStatsDataFromStats(Stats); ReferenceItem = new Item(Item); } catch (Exception ex) { Logger.LogError("Error wrapping item {0}: " + ex); } }
private void AdjustCounters(Action <IList <Thing>, Thing> change, int increment, IEnumerable <MapLocation> locations) { foreach (var mapLocation in locations) { foreach (var mapLocationThing in mapLocation.Things) { if (bossTypes.Contains(mapLocationThing.Type)) { change(Bosses, mapLocationThing); } if (enemyTypes.Contains(mapLocationThing.Type)) { change(Enemies, mapLocationThing); } if (WeaponTypes.Contains(mapLocationThing.Type)) { change(Weapons, mapLocationThing); } if (mapLocationThing.Type == Actor.Clip.ClassName) { Ammo += increment; } if (TreasureTypes.Contains(mapLocationThing.Type)) { change(Treasure, mapLocationThing); } if (HealthTypes.Contains(mapLocationThing.Type)) { change(Health, mapLocationThing); } if (mapLocationThing.Type == Actor.OneUp.ClassName) { Lives += increment; } if (mapLocationThing.Type == Actor.GoldKey.ClassName || mapLocationThing.Type == Actor.Hans.ClassName || mapLocationThing.Type == Actor.Gretel.ClassName) { goldKeys += increment; } if (mapLocationThing.Type == Actor.SilverKey.ClassName) { silverKeys += increment; } } if (mapLocation.Tile == null && !mapLocation.Things.Any()) { BoringTiles += increment; } } }