// Token: 0x06000DF4 RID: 3572 RVA: 0x000602C4 File Offset: 0x0005E4C4 public BaseItemGUI(IUnityItem item, BuyingLocationType location, BuyingRecommendationType recommendation) { this._location = location; this._recommendation = recommendation; if (item != null) { this.Item = item; if (this.Item.View.ItemType == UberstrikeItemType.Weapon) { this.DetailGUI = new WeaponItemDetailGUI(item.View as UberStrikeItemWeaponView); } else if (this.Item.View.ItemClass == UberstrikeItemClass.GearUpperBody || this.Item.View.ItemClass == UberstrikeItemClass.GearLowerBody) { UberStrikeItemGearView uberStrikeItemGearView = item.View as UberStrikeItemGearView; this._armorPoints = uberStrikeItemGearView.ArmorPoints; this.DetailGUI = new ArmorItemDetailGUI(uberStrikeItemGearView, ShopIcons.ItemarmorpointsIcon); } if (this.Item.View != null && !string.IsNullOrEmpty(this.Item.View.Description)) { this._description = this.Item.View.Description; } } else { this.Item = new BaseItemGUI.NullItem(); Debug.LogError("BaseItemGUI creation failed because item is NULL"); } }
public static UberStrikeItemGearView Deserialize(Stream bytes) { var mask = Int32Proxy.Deserialize(bytes); var view = new UberStrikeItemGearView(); view.ArmorPoints = Int32Proxy.Deserialize(bytes); view.ArmorWeight = Int32Proxy.Deserialize(bytes); if ((mask & 1) != 0) { view.CustomProperties = DictionaryProxy <string, string> .Deserialize(bytes, StringProxy.Deserialize, StringProxy.Deserialize); } if ((mask & 2) != 0) { view.Description = StringProxy.Deserialize(bytes); } view.ID = Int32Proxy.Deserialize(bytes); view.IsConsumable = BooleanProxy.Deserialize(bytes); view.ItemClass = EnumProxy <UberStrikeItemClass> .Deserialize(bytes); if ((mask & 4) != 0) { view.ItemProperties = DictionaryProxy <ItemPropertyType, int> .Deserialize(bytes, EnumProxy <ItemPropertyType> .Deserialize, Int32Proxy.Deserialize); } view.LevelLock = Int32Proxy.Deserialize(bytes); view.MaxDurationDays = Int32Proxy.Deserialize(bytes); if ((mask & 8) != 0) { view.Name = StringProxy.Deserialize(bytes); } if ((mask & 16) != 0) { view.PrefabName = StringProxy.Deserialize(bytes); } if ((mask & 32) != 0) { view.Prices = ListProxy <ItemPriceView> .Deserialize(bytes, ItemPriceViewProxy.Deserialize); } view.ShopHighlightType = EnumProxy <ItemShopHighlightType> .Deserialize(bytes); return(view); }
// Token: 0x06001114 RID: 4372 RVA: 0x0001ADB4 File Offset: 0x00018FB4 public static UberStrikeItemGearView Deserialize(Stream bytes) { int num = Int32Proxy.Deserialize(bytes); UberStrikeItemGearView uberStrikeItemGearView = new UberStrikeItemGearView(); uberStrikeItemGearView.ArmorPoints = Int32Proxy.Deserialize(bytes); uberStrikeItemGearView.ArmorWeight = Int32Proxy.Deserialize(bytes); if ((num & 1) != 0) { uberStrikeItemGearView.CustomProperties = DictionaryProxy <string, string> .Deserialize(bytes, new DictionaryProxy <string, string> .Deserializer <string>(StringProxy.Deserialize), new DictionaryProxy <string, string> .Deserializer <string>(StringProxy.Deserialize)); } if ((num & 2) != 0) { uberStrikeItemGearView.Description = StringProxy.Deserialize(bytes); } uberStrikeItemGearView.ID = Int32Proxy.Deserialize(bytes); uberStrikeItemGearView.IsConsumable = BooleanProxy.Deserialize(bytes); uberStrikeItemGearView.ItemClass = EnumProxy <UberstrikeItemClass> .Deserialize(bytes); if ((num & 4) != 0) { uberStrikeItemGearView.ItemProperties = DictionaryProxy <ItemPropertyType, int> .Deserialize(bytes, new DictionaryProxy <ItemPropertyType, int> .Deserializer <ItemPropertyType>(EnumProxy <ItemPropertyType> .Deserialize), new DictionaryProxy <ItemPropertyType, int> .Deserializer <int>(Int32Proxy.Deserialize)); } uberStrikeItemGearView.LevelLock = Int32Proxy.Deserialize(bytes); uberStrikeItemGearView.MaxDurationDays = Int32Proxy.Deserialize(bytes); if ((num & 8) != 0) { uberStrikeItemGearView.Name = StringProxy.Deserialize(bytes); } if ((num & 16) != 0) { uberStrikeItemGearView.PrefabName = StringProxy.Deserialize(bytes); } if ((num & 32) != 0) { uberStrikeItemGearView.Prices = ListProxy <ItemPrice> .Deserialize(bytes, new ListProxy <ItemPrice> .Deserializer <ItemPrice>(ItemPriceProxy.Deserialize)); } uberStrikeItemGearView.ShopHighlightType = EnumProxy <ItemShopHighlightType> .Deserialize(bytes); return(uberStrikeItemGearView); }
// Token: 0x0600143B RID: 5179 RVA: 0x00074B40 File Offset: 0x00072D40 public void GetArmorValues(out int armorPoints) { armorPoints = 0; InventoryItem inventoryItem; if (this.TryGetItemInSlot(global::LoadoutSlotType.GearLowerBody, out inventoryItem) && inventoryItem.Item.View.ItemType == UberstrikeItemType.Gear) { UberStrikeItemGearView uberStrikeItemGearView = inventoryItem.Item.View as UberStrikeItemGearView; armorPoints += uberStrikeItemGearView.ArmorPoints; } if (this.TryGetItemInSlot(global::LoadoutSlotType.GearUpperBody, out inventoryItem) && inventoryItem.Item.View.ItemType == UberstrikeItemType.Gear) { UberStrikeItemGearView uberStrikeItemGearView2 = inventoryItem.Item.View as UberStrikeItemGearView; armorPoints += uberStrikeItemGearView2.ArmorPoints; } if (this.TryGetItemInSlot(global::LoadoutSlotType.GearHolo, out inventoryItem) && inventoryItem.Item.View.ItemType == UberstrikeItemType.Gear) { UberStrikeItemGearView uberStrikeItemGearView3 = inventoryItem.Item.View as UberStrikeItemGearView; armorPoints += uberStrikeItemGearView3.ArmorPoints; } }
// Token: 0x06001113 RID: 4371 RVA: 0x0001AC04 File Offset: 0x00018E04 public static void Serialize(Stream stream, UberStrikeItemGearView instance) { int num = 0; using (MemoryStream memoryStream = new MemoryStream()) { Int32Proxy.Serialize(memoryStream, instance.ArmorPoints); Int32Proxy.Serialize(memoryStream, instance.ArmorWeight); if (instance.CustomProperties != null) { DictionaryProxy <string, string> .Serialize(memoryStream, instance.CustomProperties, new DictionaryProxy <string, string> .Serializer <string>(StringProxy.Serialize), new DictionaryProxy <string, string> .Serializer <string>(StringProxy.Serialize)); } else { num |= 1; } if (instance.Description != null) { StringProxy.Serialize(memoryStream, instance.Description); } else { num |= 2; } Int32Proxy.Serialize(memoryStream, instance.ID); BooleanProxy.Serialize(memoryStream, instance.IsConsumable); EnumProxy <UberstrikeItemClass> .Serialize(memoryStream, instance.ItemClass); if (instance.ItemProperties != null) { DictionaryProxy <ItemPropertyType, int> .Serialize(memoryStream, instance.ItemProperties, new DictionaryProxy <ItemPropertyType, int> .Serializer <ItemPropertyType>(EnumProxy <ItemPropertyType> .Serialize), new DictionaryProxy <ItemPropertyType, int> .Serializer <int>(Int32Proxy.Serialize)); } else { num |= 4; } Int32Proxy.Serialize(memoryStream, instance.LevelLock); Int32Proxy.Serialize(memoryStream, instance.MaxDurationDays); if (instance.Name != null) { StringProxy.Serialize(memoryStream, instance.Name); } else { num |= 8; } if (instance.PrefabName != null) { StringProxy.Serialize(memoryStream, instance.PrefabName); } else { num |= 16; } if (instance.Prices != null) { ListProxy <ItemPrice> .Serialize(memoryStream, instance.Prices, new ListProxy <ItemPrice> .Serializer <ItemPrice>(ItemPriceProxy.Serialize)); } else { num |= 32; } EnumProxy <ItemShopHighlightType> .Serialize(memoryStream, instance.ShopHighlightType); Int32Proxy.Serialize(stream, ~num); memoryStream.WriteTo(stream); } }
// Token: 0x06000DF2 RID: 3570 RVA: 0x0000A361 File Offset: 0x00008561 public ArmorItemDetailGUI(UberStrikeItemGearView item, Texture2D armorPointsIcon) { this._item = item; this._armorPointsIcon = armorPointsIcon; }