C# Class Aura.Channel.World.Inventory.InventoryPocket

Datei anzeigen Open project: aura-project/aura Class Usage Examples

Public Methods

Method Description
Add ( Item item ) : bool

Adds item to pocket, at the first possible position.

AddUnsafe ( Item item ) : void

Adds item to pocket, at its position.

CountItem ( bool>.Func predicate ) : int

Returns amount of items by specified conditions.

CountItem ( int itemId ) : int

Returns amount of items by item id.

CountItem ( string tag ) : int

Returns amount of items by matching tag.

FillStacks ( Item item, List &changed ) : bool

Fills stacks that take this item. Returns true if item has been completely added to stacks/sacs.

GetItem ( bool>.Func predicate, StartAt startAt ) : Item

Returns first item to match predicate, or null.

GetItem ( long entityId ) : Item

Returns item by entity id, or null.

GetItemAt ( int x, int y ) : Item

Returns the item at the location, or null.

GetItems ( bool>.Func predicate, StartAt startAt ) : List

Returns items that match predicate.

Has ( Item item ) : bool

Returns whether the item exists in this pocket.

HasSpace ( Item item ) : bool

Returns true if there's enough space for the item in this pocket.

Remove ( Item item ) : bool

Removes item from pocket.

Remove ( int itemId, int amount, List &changed ) : int

Removes items by item id and amount. Modified items are returned as a list.

TryAdd ( Item item, byte targetX, byte targetY, Item &colliding ) : bool

Attempts to put item at the coordinates. If another item is in the new item's space it's returned in colliding. Returns whether the attempt was successful.

Protected Methods

Method Description
InventoryPocket ( Pocket pocket ) : System

Method Details

Add() public abstract method

Adds item to pocket, at the first possible position.
public abstract Add ( Item item ) : bool
item Item
return bool

AddUnsafe() public abstract method

Adds item to pocket, at its position.
public abstract AddUnsafe ( Item item ) : void
item Item
return void

CountItem() public abstract method

Returns amount of items by specified conditions.
public abstract CountItem ( bool>.Func predicate ) : int
predicate bool>.Func
return int

CountItem() public abstract method

Returns amount of items by item id.
public abstract CountItem ( int itemId ) : int
itemId int
return int

CountItem() public abstract method

Returns amount of items by matching tag.
public abstract CountItem ( string tag ) : int
tag string
return int

FillStacks() public abstract method

Fills stacks that take this item. Returns true if item has been completely added to stacks/sacs.
public abstract FillStacks ( Item item, List &changed ) : bool
item Item
changed List
return bool

GetItem() public abstract method

Returns first item to match predicate, or null.
public abstract GetItem ( bool>.Func predicate, StartAt startAt ) : Item
predicate bool>.Func
startAt StartAt
return Item

GetItem() public abstract method

Returns item by entity id, or null.
public abstract GetItem ( long entityId ) : Item
entityId long
return Item

GetItemAt() public abstract method

Returns the item at the location, or null.
public abstract GetItemAt ( int x, int y ) : Item
x int
y int
return Item

GetItems() public abstract method

Returns items that match predicate.
public abstract GetItems ( bool>.Func predicate, StartAt startAt ) : List
predicate bool>.Func
startAt StartAt
return List

Has() public abstract method

Returns whether the item exists in this pocket.
public abstract Has ( Item item ) : bool
item Item
return bool

HasSpace() public abstract method

Returns true if there's enough space for the item in this pocket.
public abstract HasSpace ( Item item ) : bool
item Item
return bool

InventoryPocket() protected method

protected InventoryPocket ( Pocket pocket ) : System
pocket Pocket
return System

Remove() public abstract method

Removes item from pocket.
public abstract Remove ( Item item ) : bool
item Item
return bool

Remove() public abstract method

Removes items by item id and amount. Modified items are returned as a list.
public abstract Remove ( int itemId, int amount, List &changed ) : int
itemId int
amount int
changed List
return int

TryAdd() public abstract method

Attempts to put item at the coordinates. If another item is in the new item's space it's returned in colliding. Returns whether the attempt was successful.
public abstract TryAdd ( Item item, byte targetX, byte targetY, Item &colliding ) : bool
item Item
targetX byte
targetY byte
colliding Item
return bool