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
파일 보기 프로젝트 열기: xsochor/mooege 1 사용 예제들

공개 메소드들

메소드 설명
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