Show / Hide Table of Contents

Class DurabilityItem

Items that can get broken or spoiled, that can be discrete or continious in progression, See DurabilityItems.md for more informations.

Inheritance
System.Object
ItemLinkable
ItemRepresentation
Item
DurabilityItem
FoodItem
RepairableItem
WorldObjectItem
Implements
IItem
ILinkableParameterized<LinkConfig>
ILinkable
IHasIcon
IController
IViewController
IHasUniversalID
System.ComponentModel.INotifyPropertyChanged
Inherited Members
Item.ItemsInitialized
Item.RepresentsItemType(Type)
Item.OnLinkClicked(TooltipOrigin, TooltipClickContext, User)
Item.ClearMaxStackSizeCache()
Item.GetMaxStackSize(Type)
Item.Destroy(Int32)
Item.ToString()
Item.UnsubscribeUnique()
Item.OnUsed(Player, ItemStack)
Item.OnLeftClicked(Player, ItemStack)
Item.OnSelected(Player)
Item.OnDeselected(Player)
Item.Get(IRepresentsItem)
Item.Get(Int32)
Item.Get<T>()
Item.Get(Type)
Item.Get(String)
Item.ShowName(Type, Single)
Item.ShowName(Type, Int32)
Item.ShowName<T>(Int32)
Item.NameAndNum(Type, Int32)
Item.GetSkillbookForSkillType(Type)
Item.CreatingItem(Type)
Item.GetCreatedObj(Type)
Item.TypeIsUnique(Type)
Item.GetNonUniqueOrClone(Int32)
Item.GetNonUniqueOrClone(Type)
Item.NameAndNum(Type, Single)
Item.Initialize()
Item.GetItemByString(User, String)
Item.GetID(Item)
Item.GetID(Type)
Item.HasID(Type)
Item.GetID<T>()
Item.GetType(Int32)
Item.GetType(String)
Item.Create<T>(Int32)
Item.Create(Type, Int32)
Item.Create<T>()
Item.Create(Type)
Item.IconName
Item.IconComment
Item.TypeID
Item.Type
Item.DisplayName
Item.Name
Item.IsUnique
Item.Fuel
Item.IsFuel
Item.WeightWithoutModifiers
Item.Weight
Item.HasWeight
Item.IsCarried
Item.IgnoreAuth
Item.Yield
Item.HasYield
Item.HasCrop
Item.CanBeCurrency
Item.MakesRoads
Item.Compostable
Item.ResourcePile
Item.CanAirInteraction
Item.Category
Item.Hidden
Item.Group
Item.MaxStackSize
Item.IsWasteProduct
Item.GetDescription
Item.HandOrigin
Item.CanBeHeld
Item.IsTool
Item.CustomHighlight
Item.AllItemsIncludingHidden
Item.AllItemsExceptHidden
Item.RandomItem
ItemRepresentation.RepresentsItemType(Item)
ItemLinkable.ShowName(Single)
ItemLinkable.ShowName(Int32)
ItemLinkable.UILinkAndNumber(Single)
ItemLinkable.UILinkAndNumber(Int32)
ItemLinkable.UILinkAndNumber(Int32, String)
ItemLinkable.UILinkAndNumberAndTier(Int32, Int32)
ItemLinkable.UILinkAndNumberAndTierPrepend(Int32, Int32, String)
ItemLinkable.UILinkAndNumberNoText(Int32)
ItemLinkable.UILinkContent()
ItemLinkable.UILinkContent(Boolean)
ItemLinkable.NameAndNum(Int32)
ItemLinkable.UILinkAndStyledNumber(Int32)
ItemLinkable.UILinkContent(LocString)
ItemLinkable.UILinkNoNumber(Int32)
ItemLinkable.UILinkContent(LinkConfig)
ItemLinkable.ItemIconUILink(LocString)
ItemLinkable.DisplayNamePlural
ItemLinkable.MarkedUpName
ItemLinkable.ControllerID
Namespace: Eco.Gameplay.Items
Assembly: Eco.Gameplay.dll
Syntax
public abstract class DurabilityItem : Item, IItem, ILinkableParameterized<LinkConfig>, ILinkable, IHasIcon, IController, IViewController, IHasUniversalID, INotifyPropertyChanged

Constructors

DurabilityItem()

Declaration
protected DurabilityItem()

Properties

Broken

Declaration
public bool Broken { get; protected set; }
Property Value
Type Description
System.Boolean

BrokenDescription

Declaration
public virtual LocString BrokenDescription { get; }
Property Value
Type Description
LocString

Decays

Declaration
public virtual bool Decays { get; }
Property Value
Type Description
System.Boolean

DefaultMinRequiredDurabilityInTradeOffers

Declaration
public virtual float DefaultMinRequiredDurabilityInTradeOffers { get; }
Property Value
Type Description
System.Single

DisplayDurability

Declaration
public string DisplayDurability { get; }
Property Value
Type Description
System.String

DurabilityPercent

Declaration
public virtual float DurabilityPercent { get; }
Property Value
Type Description
System.Single

IsStackable

Declaration
public override bool IsStackable { get; }
Property Value
Type Description
System.Boolean
Overrides
Item.IsStackable

OriginalMaxDurability

Declaration
public virtual float OriginalMaxDurability { get; }
Property Value
Type Description
System.Single

PercentBrokenFromOriginal

Declaration
public virtual float PercentBrokenFromOriginal { get; }
Property Value
Type Description
System.Single

StackingHash

Declaration
public override int StackingHash { get; }
Property Value
Type Description
System.Int32
Overrides
Item.StackingHash

Methods

CanStack(Item)

Declaration
public override bool CanStack(Item other)
Parameters
Type Name Description
Item other
Returns
Type Description
System.Boolean
Overrides
Item.CanStack(Item)

Clone()

Declaration
public override Item Clone()
Returns
Type Description
Item
Overrides
Item.Clone()

GetDurability()

Declaration
public abstract float GetDurability()
Returns
Type Description
System.Single

GetQualityGroup()

Declaration
public virtual int GetQualityGroup()
Returns
Type Description
System.Int32

Merge(Item, Int32, Int32, Boolean)

Update Durability value before merging items to apply correct durability value.

Declaration
public override Item Merge(Item mergingInto, int thisCount, int otherCount, bool splittingStack)
Parameters
Type Name Description
Item mergingInto
System.Int32 thisCount
System.Int32 otherCount
System.Boolean splittingStack
Returns
Type Description
Item
Overrides
Item.Merge(Item, Int32, Int32, Boolean)

RepresentativeHash()

Declaration
public override int RepresentativeHash()
Returns
Type Description
System.Int32
Overrides
ItemRepresentation.RepresentativeHash()

RepresentsItem(Item)

Declaration
public override bool RepresentsItem(Item other)
Parameters
Type Name Description
Item other
Returns
Type Description
System.Boolean
Overrides
Item.RepresentsItem(Item)

SetDurability(Single)

Declaration
public abstract void SetDurability(float d)
Parameters
Type Name Description
System.Single d

Events

PropertyChanged

Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Type
Type Description
System.ComponentModel.PropertyChangedEventHandler

Implements

IItem
ILinkableParameterized<T>
ILinkable
IHasIcon
IController
IViewController
IHasUniversalID
System.ComponentModel.INotifyPropertyChanged

Extension Methods

ItemStackExtensions.NameAndNum(ItemRepresentation, Int32)
ItemUtils.CanItemExistInInventories(Item)
ItemUtils.CloneIfNeeded(Item)
TagUtils.Tags(Item)
TagUtils.TagNames(Object, Boolean)
TagUtils.TagDisplayNames(Object, Boolean)
ClientSetViewExtensions.SetClassOfProperty(Object, Player, String, String, Int32)
MarketplaceExtensions.IsPaidItem(Item)
TypeTooltipExtensions.UILinkGeneric(Object)
EconomyTooltipLibrary.BuyItTooltip(Item, User, TooltipOrigin)
EconomyTooltipLibrary.SellItTooltip(Item, User, TooltipOrigin)
ILinkableTooltipLibrary.ItemLinkClicked(Item, TooltipOrigin)
☀
☾
In This Article
Back to top
Copyright (c) Strange Loop Games 2021
☀
☾