Class Inventory.Item
[Serializable]
public class Inventory.Item : IState, IComparer<Inventory.Item>, IComparable<Inventory.Item>
- Inheritance
-
Inventory.Item
- Implements
- Inherited Members
Constructors
Item(Dictionary)
public Item(Dictionary serialized)
Parameters
serialized
Dictionary
Item(ItemBase, int)
public Item(ItemBase itemBase, int count = 1)
Parameters
Fields
Lock
public ILock Lock
Field Value
count
public int count
Field Value
item
public ItemBase item
Field Value
Properties
Locked
public bool Locked { get; }
Property Value
Methods
Compare(Item, Item)
Compares two objects and returns a value indicating whether one is less than, equal to, or greater than the other.
public int Compare(Inventory.Item x, Inventory.Item y)
Parameters
Returns
- int
A signed integer that indicates the relative values of
x
andy
, as shown in the following table.Value Meaning Less than zero x
is less thany
.Zero x
equalsy
.Greater than zero x
is greater thany
.
CompareTo(Item)
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
public int CompareTo(Inventory.Item other)
Parameters
Returns
- int
A value that indicates the relative order of the objects being compared. The return value has these meanings:
Value Meaning Less than zero This instance precedes other
in the sort order.Zero This instance occurs in the same position in the sort order as other
.Greater than zero This instance follows other
in the sort order.
Equals(Item)
protected bool Equals(Inventory.Item other)
Parameters
Returns
Equals(object)
Determines whether the specified object is equal to the current object.
public override bool Equals(object obj)
Parameters
obj
objectThe object to compare with the current object.
Returns
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
LockUp(ILock)
public void LockUp(ILock iLock)
Parameters
iLock
ILock
Serialize()
public IValue Serialize()
Returns
- IValue
Unlock()
public void Unlock()