Skip to content

CommunityItemInterface

Nikey646 edited this page Jun 9, 2016 · 2 revisions

Description

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.

Details

  • Namespace
  • FortressCraft.Community
  • Type
  • Interface
  • Name
  • CommunityItemInterface
  • Version Introduced
  • v1.0
  • Latest Changes
  • v1.0

Methods

Available Methods:

Has Item

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.

Has Items

Definition: Boolean HasItems()
Description: This method will check to see if the implementing machine has any items available.

Has Items Optional

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.

Has Free Space

Definition: Boolean HasFreeSpace(UInt32)
Description: This method will check to see if the implementing machine has the specified free space available.

Get Free Space

Definition: Int32 GetFreeSpace()
Description: This method will return the amount of free space available in the implementing machine.

Give Item

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.

Take Any Item

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.

Take Item

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.

Clone this wiki locally