Package de.extio.spacecraft.shared.bo
Interface StorageEntitySupport
-
public interface StorageEntitySupportHelpers to handle storage (inventory) of entities You can access the corresponding bean implementation via EngineFacade::getBusinessObject / ServerFacade::getBusinessObject
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcreate(StorageProviderEntity entity)Callback from entity to make storage functionality work.voidlocalInit(StorageProviderEntity entity, StorageProviderEntityDef entityDef)Callback from entity to make storage functionality work.voidonClientActionMessage(PhysicalEntity storageProviderEntity, GameActionMessage message)Callback from entity to make storage functionality work.voidonClientDrawConsoleControls(StorageProviderEntity entity, ScrollBar clientInventoryScrollBar, List<org.apache.commons.lang3.tuple.Pair<String,String>> additionalDisplayItems, boolean controlsActive, List<ClientConsoleControlSet> consoleControls)Callback from entity to make storage functionality work.voidonClientDrawEntityAction(PhysicalEntity storageProviderEntity, List<RenderingBo> renderingBo, String action, boolean pending, CoordI2 subTileOffset)Callback from entity to make storage functionality work.voidonClientDrawEntityActions(PhysicalEntity storageProviderEntity, List<RenderingBo> renderingBo)Callback from entity to make storage functionality work.voidonServerConsoleControlEvent(PhysicalEntity storageProviderEntity, GameSession gameSession, UUID sender, String controlId, Object payload)Callback from entity to make storage functionality work.voidonServerDamage(PhysicalEntity storageProviderEntity, GameSession gameSession, double oldHealth)Callback from entity to make storage functionality work.voidonServerTurnPass0(PhysicalEntity storageProviderEntity, GameSession gameSession)Callback from entity to make storage functionality work.static StorageEntitySupportprovide()intstorageAdd(StorageProviderEntity storageProviderEntity, int entityDefIdx, int units)Adds items to the storagevoidstorageEject(StorageProviderEntity storageProviderEntity)Ejects all items from storagevoidstorageEjectSingle(StorageProviderEntity storageProviderEntity, int entityDefIdx, int amount)Ejects single items from storagevoidstorageExplode(StorageProviderEntity storageProviderEntity)Let's the storage contents explode, e.g.voidstorageRecreate(StorageProviderEntity entity)Resets internal storage state, required when storage entity has been loaded from disk.intstorageTake(StorageProviderEntity storageProviderEntity, int entityDefIdx, int units)Takes items from the storageintstorageTransfer(StorageProviderEntity source, StorageProviderEntity destination, int entityDefIdx, int units)Transfers items between storagesvoidupdate(StorageProviderEntity entity, StorageProviderEntity other)Callback from entity to make storage functionality work.
-
-
-
Method Detail
-
provide
static StorageEntitySupport provide()
-
storageAdd
int storageAdd(StorageProviderEntity storageProviderEntity, int entityDefIdx, int units)
Adds items to the storage
-
storageTake
int storageTake(StorageProviderEntity storageProviderEntity, int entityDefIdx, int units)
Takes items from the storage
-
storageTransfer
int storageTransfer(StorageProviderEntity source, StorageProviderEntity destination, int entityDefIdx, int units)
Transfers items between storages
-
storageEject
void storageEject(StorageProviderEntity storageProviderEntity)
Ejects all items from storage
-
storageEjectSingle
void storageEjectSingle(StorageProviderEntity storageProviderEntity, int entityDefIdx, int amount)
Ejects single items from storage
-
storageExplode
void storageExplode(StorageProviderEntity storageProviderEntity)
Let's the storage contents explode, e.g. when the storage has been destroyed
-
storageRecreate
void storageRecreate(StorageProviderEntity entity)
Resets internal storage state, required when storage entity has been loaded from disk. If you derive from core storage entities this is already handled
-
create
void create(StorageProviderEntity entity)
Callback from entity to make storage functionality work. If you derive from core storage entities this is already handled, otherwise call it from the respective entity method
-
localInit
void localInit(StorageProviderEntity entity, StorageProviderEntityDef entityDef)
Callback from entity to make storage functionality work. If you derive from core storage entities this is already handled, otherwise call it from the respective entity method
-
update
void update(StorageProviderEntity entity, StorageProviderEntity other)
Callback from entity to make storage functionality work. If you derive from core storage entities this is already handled, otherwise call it from the respective entity method
-
onClientDrawEntityAction
void onClientDrawEntityAction(PhysicalEntity storageProviderEntity, List<RenderingBo> renderingBo, String action, boolean pending, CoordI2 subTileOffset)
Callback from entity to make storage functionality work. If you derive from core storage entities this is already handled, otherwise call it from the respective entity method
-
onClientDrawEntityActions
void onClientDrawEntityActions(PhysicalEntity storageProviderEntity, List<RenderingBo> renderingBo)
Callback from entity to make storage functionality work. If you derive from core storage entities this is already handled, otherwise call it from the respective entity method
-
onClientDrawConsoleControls
void onClientDrawConsoleControls(StorageProviderEntity entity, ScrollBar clientInventoryScrollBar, List<org.apache.commons.lang3.tuple.Pair<String,String>> additionalDisplayItems, boolean controlsActive, List<ClientConsoleControlSet> consoleControls)
Callback from entity to make storage functionality work. If you derive from core storage entities this is already handled, otherwise call it from the respective entity method
-
onClientActionMessage
void onClientActionMessage(PhysicalEntity storageProviderEntity, GameActionMessage message)
Callback from entity to make storage functionality work. If you derive from core storage entities this is already handled, otherwise call it from the respective entity method
-
onServerTurnPass0
void onServerTurnPass0(PhysicalEntity storageProviderEntity, GameSession gameSession)
Callback from entity to make storage functionality work. If you derive from core storage entities this is already handled, otherwise call it from the respective entity method
-
onServerDamage
void onServerDamage(PhysicalEntity storageProviderEntity, GameSession gameSession, double oldHealth)
Callback from entity to make storage functionality work. If you derive from core storage entities this is already handled, otherwise call it from the respective entity method
-
onServerConsoleControlEvent
void onServerConsoleControlEvent(PhysicalEntity storageProviderEntity, GameSession gameSession, UUID sender, String controlId, Object payload)
Callback from entity to make storage functionality work. If you derive from core storage entities this is already handled, otherwise call it from the respective entity method
-
-