Quantum Engineering
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
InventoryHandler Class Reference

Public Member Functions

 InventoryHandler (PlayerController playerController, InventoryManager playerInventory)
 This class handles inventory related functions that don't directly require the OnGUI method. More...
 
IEnumerator NetworkStorageCoroutine (int storageInventoryDropSlot, InventorySlot dropSlot)
 When an item is moved from one slot to another in a container, the contents of both slots are updated on the server. More...
 
void SearchComputerContainers (StorageComputer computer, string term)
 Searches for items in all containers connected to the computer. More...
 
void DragItemFromSlot (int index, InventorySlot dragSlot, InventoryManager destination)
 Begins dragging an item from an inventory slot. More...
 
void DropItemInSlot (Vector2 mousePos, bool usingContainer)
 Drops an item into an inventory slot. More...
 

Public Attributes

string itemToDrag
 

Private Member Functions

bool CanTransfer (InventorySlot dragSlot, InventorySlot dropSlot)
 Returns true if the item can be transferred from dragSlot to dropSlot. More...
 
void NetworkRemoveItem ()
 Updates the server when items are removed from storage containers in multiplayer games. More...
 

Private Attributes

PlayerController playerController
 
InventoryManager playerInventory
 
InventorySlot slotDraggingFrom
 
GuiCoordinates guiCoordinates
 
Coroutine networkStorageCoroutine
 
bool networkStorageCoroutineBusy
 
int amountToDrag
 
int dragSlotIndex
 

Constructor & Destructor Documentation

◆ InventoryHandler()

InventoryHandler.InventoryHandler ( PlayerController  playerController,
InventoryManager  playerInventory 
)
inline

This class handles inventory related functions that don't directly require the OnGUI method.

Member Function Documentation

◆ CanTransfer()

bool InventoryHandler.CanTransfer ( InventorySlot  dragSlot,
InventorySlot  dropSlot 
)
inlineprivate

Returns true if the item can be transferred from dragSlot to dropSlot.

◆ DragItemFromSlot()

void InventoryHandler.DragItemFromSlot ( int  index,
InventorySlot  dragSlot,
InventoryManager  destination 
)
inline

Begins dragging an item from an inventory slot.

◆ DropItemInSlot()

void InventoryHandler.DropItemInSlot ( Vector2  mousePos,
bool  usingContainer 
)
inline

Drops an item into an inventory slot.

◆ NetworkRemoveItem()

void InventoryHandler.NetworkRemoveItem ( )
inlineprivate

Updates the server when items are removed from storage containers in multiplayer games.

◆ NetworkStorageCoroutine()

IEnumerator InventoryHandler.NetworkStorageCoroutine ( int  storageInventoryDropSlot,
InventorySlot  dropSlot 
)
inline

When an item is moved from one slot to another in a container, the contents of both slots are updated on the server.

◆ SearchComputerContainers()

void InventoryHandler.SearchComputerContainers ( StorageComputer  computer,
string  term 
)
inline

Searches for items in all containers connected to the computer.

Member Data Documentation

◆ amountToDrag

int InventoryHandler.amountToDrag
private

◆ dragSlotIndex

int InventoryHandler.dragSlotIndex
private

◆ guiCoordinates

GuiCoordinates InventoryHandler.guiCoordinates
private

◆ itemToDrag

string InventoryHandler.itemToDrag

◆ networkStorageCoroutine

Coroutine InventoryHandler.networkStorageCoroutine
private

◆ networkStorageCoroutineBusy

bool InventoryHandler.networkStorageCoroutineBusy
private

◆ playerController

PlayerController InventoryHandler.playerController
private

◆ playerInventory

InventoryManager InventoryHandler.playerInventory
private

◆ slotDraggingFrom

InventorySlot InventoryHandler.slotDraggingFrom
private

The documentation for this class was generated from the following file: