C# Класс Mooege.Core.GS.Common.InventoryGrid

This class handels the gridlayout of an stash. Possible usecases are the inventory backpack, shared stash, traders stash,... Stash is organized by adding an item to EVERY slot it fills
Наследование: IRevealable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
AddItem ( Item item ) : bool

Adds an Item at a free spot to the backpack

AddItem ( Item item, int row, int column ) : void

Adds an item to the backpack

Contains ( Item item ) : bool
Contains ( uint itemID ) : bool

Checks whether the inventory contains an item

FreeSpace ( Item item, int row, int column ) : bool
HasFreeSpace ( Item item ) : System.Boolean
InventoryGrid ( Mooege.Core.GS.Actors.Actor owner, int rows, int columns, int slot ) : System
RemoveItem ( Item item ) : void

Removes an item from the backpack

ResizeGrid ( int rows, int columns ) : void
Reveal ( Player player ) : bool
Unreveal ( Player player ) : bool

Приватные методы

Метод Описание
CollectOverlappingItems ( Item item, int row, int column ) : int

Collects (counts) the items overlapping with the item about to be dropped. If there are none, drop item If there is exacly one, swap it with item (TODO) If there are more, item cannot be dropped

FindSlotForItem ( Item item ) : InventorySlot?

Find an inventory slot with enough space for an item

GetItemInventorySize ( Item item ) : InventorySize

Описание методов

AddItem() публичный Метод

Adds an Item at a free spot to the backpack
public AddItem ( Item item ) : bool
item Item
Результат bool

AddItem() публичный Метод

Adds an item to the backpack
public AddItem ( Item item, int row, int column ) : void
item Item
row int
column int
Результат void

Contains() публичный Метод

public Contains ( Item item ) : bool
item Item
Результат bool

Contains() публичный Метод

Checks whether the inventory contains an item
public Contains ( uint itemID ) : bool
itemID uint
Результат bool

FreeSpace() публичный Метод

public FreeSpace ( Item item, int row, int column ) : bool
item Item
row int
column int
Результат bool

HasFreeSpace() публичный Метод

public HasFreeSpace ( Item item ) : System.Boolean
item Item
Результат System.Boolean

InventoryGrid() публичный Метод

public InventoryGrid ( Mooege.Core.GS.Actors.Actor owner, int rows, int columns, int slot ) : System
owner Mooege.Core.GS.Actors.Actor
rows int
columns int
slot int
Результат System

RemoveItem() публичный Метод

Removes an item from the backpack
public RemoveItem ( Item item ) : void
item Item
Результат void

ResizeGrid() публичный Метод

public ResizeGrid ( int rows, int columns ) : void
rows int
columns int
Результат void

Reveal() публичный Метод

public Reveal ( Player player ) : bool
player Player
Результат bool

Unreveal() публичный Метод

public Unreveal ( Player player ) : bool
player Player
Результат bool