Package de.extio.spacecraft.shared.bo
Interface StorageEntitySupport
-
public interface StorageEntitySupport
Helpers 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 void
create(StorageProviderEntity entity)
Callback from entity to make storage functionality work.void
localInit(StorageProviderEntity entity, StorageProviderEntityDef entityDef)
Callback from entity to make storage functionality work.void
onClientActionMessage(PhysicalEntity storageProviderEntity, GameActionMessage message)
Callback from entity to make storage functionality work.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.void
onClientDrawEntityAction(PhysicalEntity storageProviderEntity, List<RenderingBo> renderingBo, String action, boolean pending, CoordI2 subTileOffset)
Callback from entity to make storage functionality work.void
onClientDrawEntityActions(PhysicalEntity storageProviderEntity, List<RenderingBo> renderingBo)
Callback from entity to make storage functionality work.void
onServerConsoleControlEvent(PhysicalEntity storageProviderEntity, GameSession gameSession, UUID sender, String controlId, Object payload)
Callback from entity to make storage functionality work.void
onServerDamage(PhysicalEntity storageProviderEntity, GameSession gameSession, double oldHealth)
Callback from entity to make storage functionality work.void
onServerTurnPass0(PhysicalEntity storageProviderEntity, GameSession gameSession)
Callback from entity to make storage functionality work.static StorageEntitySupport
provide()
int
storageAdd(StorageProviderEntity storageProviderEntity, int entityDefIdx, int units)
Adds items to the storagevoid
storageEject(StorageProviderEntity storageProviderEntity)
Ejects all items from storagevoid
storageEjectSingle(StorageProviderEntity storageProviderEntity, int entityDefIdx, int amount)
Ejects single items from storagevoid
storageExplode(StorageProviderEntity storageProviderEntity)
Let's the storage contents explode, e.g.void
storageRecreate(StorageProviderEntity entity)
Resets internal storage state, required when storage entity has been loaded from disk.int
storageTake(StorageProviderEntity storageProviderEntity, int entityDefIdx, int units)
Takes items from the storageint
storageTransfer(StorageProviderEntity source, StorageProviderEntity destination, int entityDefIdx, int units)
Transfers items between storagesvoid
update(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
-
-