-
Notifications
You must be signed in to change notification settings - Fork 4
CommunityItemInterface
This is a simple interface that hopes to act as a stop gap to allow communicating between mods based off of an Interface until the official item interfaces are implemented. It provides the simplest set of interactions with the intention of the implementing class correctly handling the Item from a ItemBase. This includes, determining if it is a Cube or Item, and responding appropriately.
- Namespace
- FortressCraft.Community
- Type
- Interface
- Name
- CommunityItemInterface
- Version Introduced
- v1.0
- Latest Changes
- v1.0
Boolean HasItem(ItemBase)Boolean HasItems()Boolean HasItems(ItemBase, out Int32)Boolean HasFreeSpace(UInt32)Int32 GetFreeSpace()Boolean GiveItem(ItemBase)ItemBase TakeAnyItem()ItemBase TakeItem(ItemBase)
Definition: Boolean HasItem(ItemBase)
Description: This method will check to see if the implementing machine has the requested item. The implementing machine must obey the mnAmount value of stack-able items, ensuring that it has at least the mnAmount of the item available.
Definition: Boolean HasItems()
Description: This method will check to see if the implementing machine has any items available.
Definition: Boolean HasItems(ItemBase, out Int32)
Description: This method will check to see if the implementing machine has the requested item, and provide the amount.
Definition: Boolean HasFreeSpace(UInt32)
Description: This method will check to see if the implementing machine has the specified free space available.
Definition: Int32 GetFreeSpace()
Description: This method will return the amount of free space available in the implementing machine.
Definition: Boolean GiveItem(ItemBase)
Description: This method will attempt to give the implementing machine the item. The implementing machine may only return if all of the item was stored, and must respect the mnAmount of stack-able items.
Definition: ItemBase TakeAnyItem()
Description: This method will attempt to take any item from the implementing machine. If the implementing machine holds more than 1 item, it should return a random item, or optionally throw a NotImplementedException.
Definition: ItemBase TakeItem(ItemBase)
Description: This method will attempt to take the requested item from the implementing machines storage.
If the implementing machine only holds 1 item, it may only return the requested item if it matches the stored item, otherwise it must return null or throw a NotImplementedException
The implementing machine must obey the mnAmount of the requested item.
The implementing machine must return null if it does not contain the item, or throw an ArgumentNullException.