Class ItemRepresentation
Represents a specific item or a group of items.
Inherited Members
Namespace: Eco.Gameplay.Items
Assembly: Eco.Gameplay.dll
Syntax
public abstract class ItemRepresentation : ItemLinkable, IController, IViewController, IHasUniversalID, ILinkableParameterized<LinkConfig>, ILinkable
Constructors
ItemRepresentation()
Declaration
protected ItemRepresentation()
Methods
RepresentativeHash()
If two items have the same hash they're identical. Note that this doesnt use 'quality groups', only exact identical.
Declaration
public virtual int RepresentativeHash()
Returns
Type | Description |
---|---|
System. |
RepresentsItem(Item)
Checks if this instance represents the given item taking into the account its type and any unique properties it might have, like durability level, using rules defined for that specific item type.
Declaration
public abstract bool RepresentsItem(Item item)
Parameters
Type | Name | Description |
---|---|---|
Item | item |
Returns
Type | Description |
---|---|
System. |
Remarks
Use this method if you need custom comparison rules for unique items, like similar durability levels or same associated settlement.
If only item type is relevant, use Represents
RepresentsItemType(Item)
Checks if this instance represents an item of the same type as item
.
If this instance represents more than one item type it checks if those types include that one.
Declaration
public bool RepresentsItemType(Item item)
Parameters
Type | Name | Description |
---|---|---|
Item | item |
Returns
Type | Description |
---|---|
System. |
Remarks
This method of checking for item match ignores any unique properties an item instance might have and only checks the type.
If matching some conditions other than type for a unique item (like durability level) is necessary use Represents
RepresentsItemType(Type)
Checks if this instance represents an item of the given type. If this instance represents more than one item type it checks if those types include that one.
Declaration
public abstract bool RepresentsItemType(Type itemType)
Parameters
Type | Name | Description |
---|---|---|
System. |
itemType |
Returns
Type | Description |
---|---|
System. |
Remarks
This method of checking for item match ignores any unique properties an item instance might have and only checks the type.
If matching some conditions other than type for a unique item (like durability level) is necessary use Represents