C# Class MiningGameServer.PlayerClasses.PlayerInventory

Show file Open project: geel9/Minor-Destruction Class Usage Examples

Public Properties

Property Type Description
Inventory ItemStack[]
NetworkPlayer NetworkPlayer
PlayerInventorySelected int

Public Methods

Method Description
CanPickup ( ItemStack item, int slotStart = -1 ) : int

Returns the amount of an ItemStack that will be left. 0 if all are picked up.

EmptyBag ( ) : void
GetNumItemInInventory ( byte id ) : int
GetPlayerItemInHand ( ) : ServerItem
GetPlayerItemStackFromInventory ( byte id ) : ItemStack
GetPlayerItemStackInHand ( ) : ItemStack
HasItem ( byte id ) : bool
PickupItem ( ItemStack item, bool overflow = false ) : void

Picks up an item into the inventory

PlayerInventory ( NetworkPlayer player ) : System
RemoveItemAt ( int slot ) : void
RemoveItems ( byte itemID, int numToRemove ) : void
RemoveItemsAtSlot ( int slot, byte itemID, int numToRemove ) : void
SetBagSize ( int size ) : void

Method Details

CanPickup() public method

Returns the amount of an ItemStack that will be left. 0 if all are picked up.
public CanPickup ( ItemStack item, int slotStart = -1 ) : int
item ItemStack The ItemStack to test against
slotStart int Used for recursion.
return int

EmptyBag() public method

public EmptyBag ( ) : void
return void

GetNumItemInInventory() public method

public GetNumItemInInventory ( byte id ) : int
id byte
return int

GetPlayerItemInHand() public method

public GetPlayerItemInHand ( ) : ServerItem
return MiningGameServer.Items.ServerItem

GetPlayerItemStackFromInventory() public method

public GetPlayerItemStackFromInventory ( byte id ) : ItemStack
id byte
return ItemStack

GetPlayerItemStackInHand() public method

public GetPlayerItemStackInHand ( ) : ItemStack
return ItemStack

HasItem() public method

public HasItem ( byte id ) : bool
id byte
return bool

PickupItem() public method

Picks up an item into the inventory
public PickupItem ( ItemStack item, bool overflow = false ) : void
item ItemStack The ItemStack to pick up
overflow bool If true, then the extra items that are left over (can't be picked up) are dropped.
return void

PlayerInventory() public method

public PlayerInventory ( NetworkPlayer player ) : System
player NetworkPlayer
return System

RemoveItemAt() public method

public RemoveItemAt ( int slot ) : void
slot int
return void

RemoveItems() public method

public RemoveItems ( byte itemID, int numToRemove ) : void
itemID byte
numToRemove int
return void

RemoveItemsAtSlot() public method

public RemoveItemsAtSlot ( int slot, byte itemID, int numToRemove ) : void
slot int
itemID byte
numToRemove int
return void

SetBagSize() public method

public SetBagSize ( int size ) : void
size int
return void

Property Details

Inventory public property

public ItemStack[] Inventory
return ItemStack[]

NetworkPlayer public property

public NetworkPlayer NetworkPlayer
return NetworkPlayer

PlayerInventorySelected public property

public int PlayerInventorySelected
return int