Class StructureEntity
- java.lang.Object
-
- de.extio.spacecraft.shared.model.entity.AbstractEntity
-
- de.extio.spacecraft.shared.model.entity.builtin.live.PhysicalEntity
-
- de.extio.spacecraft.shared.model.entity.builtin.live.StructureEntity
-
- All Implemented Interfaces:
StorableEntity,HasPosition2,HasPositionAndDimension2
- Direct Known Subclasses:
AbstractWeaponEntity
public class StructureEntity extends PhysicalEntity implements StorableEntity
Structure entities are a specialized form of physical entities - everything that is part of the structure of a ship: walls, systems, engines, weapons, ...
-
-
Field Summary
Fields Modifier and Type Field Description protected booleandisplayCooldown-
Fields inherited from class de.extio.spacecraft.shared.model.entity.builtin.live.PhysicalEntity
clientEntityActionQueue, clientPoseAnimation, clientPoseTilesetPosition, enabled, entityAction, entityActionPending, entityActionPendingTurn, entityActionPlayer, entityActionTarget, entityActionTargetCoord, health, loggedInEntity, onDamageDestroyImmediately, onDamageSplit, onDamageSplitThreshold, pathFindingEntitySupport
-
Fields inherited from class de.extio.spacecraft.shared.model.entity.AbstractEntity
LOGGER, serverRestrictedEntities, serverRestrictedEntitySurfaceBo
-
-
Constructor Summary
Constructors Constructor Description StructureEntity()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreate(UUID uuid, AbstractEntityDef entityDef, int entityDefIdx, UUID parentCompositeEntity)Central initialization of non-transient fields (usually on server side).protected voidenableEntity(boolean enable)Server side: Called when the enabled state changedintgetCooldown()intgetTransformedEdges()booleanisCooldownDisablesEntity()booleanisOperational()Returns whether the entity is ready to execute actionsvoidlocalInit(AbstractEntityDef entityDef)Local initialization of transient fieldsvoidonClientDrawEntity(List<RenderingBo> renderingBo)Client side: Draws this entityvoidonServerStorageExplode(GameSession gameSession)voidonServerTurnPass0(GameSession gameSession)Server side: Executes code on every server turn, main pass 1 of 2.booleanserverRestrictEntity(UUID recipient, AbstractCompositeEntity parent, GameSession gameSession)Server side: Checks whether this entity should be restricted to the player recipient, i.e.voidsetCooldown(int cooldown)voidsetCooldownDisablesEntity(boolean cooldownDisablesEntity)voidupdate(AbstractEntity other)Incremental update of non-transient fields (usually transferred from server)-
Methods inherited from class de.extio.spacecraft.shared.model.entity.builtin.live.PhysicalEntity
getEntityAction, getEntityActionPending, getEntityActionTarget, getEntityActionTargetCoord, getHealth, getLoggedInEntity, getOnDamageSplitThreshold, getPathFindingEntitySupport, getSubTileOffset, getTilesetPosition, handleEnabledState, isEnabled, isOnDamageDestroyImmediately, isOnDamageSplit, localCopy, nextClientEntityAction, onClientAction, onClientActionMessage, onClientComplexConsoleControlEvent, onClientComplexConsoleControlEvent, onClientDamage, onClientDrawConsoleControls, onClientDrawEntityAction, onClientDrawEntityActions, onClientFrame, onClientGenerateEntityDetails, onClientSelectedPointToEntity, onClientSelectedPointToNoClientEntityAction, onServerActionMessage, onServerConsoleControlEvent, onServerDamage, onServerTurnPass1, serverAbortEntityAction, serverCalculateEmEmission, serverSetEntityAction, serverSplitOnDamage, serverTranslateEntityPass1, setClientActions, setEnabled, setHealth, setLoggedInEntity, setOnDamageDestroyImmediately, setOnDamageSplit, setOnDamageSplitThreshold
-
Methods inherited from class de.extio.spacecraft.shared.model.entity.AbstractEntity
createClientDrawTileImageBo, getDimension, getEntityDef, getEntityDefUUID, getEntityLayer, getEntityManager, getOrientation, getParentCompositeEntity, getPosition, getServerRestrictedEntities, getServerRestrictEntitiesLastUpdate, getServerRestrictEntitiesWalls, getTileset, getUuid, isDirty, isLocalInit, onClientSelectedPointToWorldPos, onServerTurnPass2PostComposites, serverCleanupRestrictedEntities, serverPrepareRestrictedEntities, serverTranslateEntityPass0, setDirty, setEntityDef, setEntityManager, setLocalInit, setOrientation, setParentCompositeEntity, setPosition, setServerRestrictedEntities, setServerRestrictEntitiesLastUpdate, setServerRestrictEntitiesWalls, setUuid
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.extio.spacecraft.shared.model.entity.builtin.live.StorableEntity
onServerStorageEject
-
-
-
-
Method Detail
-
create
public void create(UUID uuid, AbstractEntityDef entityDef, int entityDefIdx, UUID parentCompositeEntity)
Description copied from class:AbstractEntityCentral initialization of non-transient fields (usually on server side). Is only called once in the whole life cycle of an entity.- Overrides:
createin classPhysicalEntity
-
update
public void update(AbstractEntity other)
Description copied from class:AbstractEntityIncremental update of non-transient fields (usually transferred from server)- Overrides:
updatein classPhysicalEntity
-
localInit
public void localInit(AbstractEntityDef entityDef)
Description copied from class:AbstractEntityLocal initialization of transient fields- Overrides:
localInitin classPhysicalEntity
-
onClientDrawEntity
public void onClientDrawEntity(List<RenderingBo> renderingBo)
Description copied from class:AbstractEntityClient side: Draws this entity- Overrides:
onClientDrawEntityin classPhysicalEntity
-
onServerTurnPass0
public void onServerTurnPass0(GameSession gameSession)
Description copied from class:AbstractEntityServer side: Executes code on every server turn, main pass 1 of 2. Executed after composite entities pass 0- Overrides:
onServerTurnPass0in classPhysicalEntity
-
onServerStorageExplode
public void onServerStorageExplode(GameSession gameSession)
- Specified by:
onServerStorageExplodein interfaceStorableEntity
-
serverRestrictEntity
public boolean serverRestrictEntity(UUID recipient, AbstractCompositeEntity parent, GameSession gameSession)
Description copied from class:AbstractEntityServer side: Checks whether this entity should be restricted to the player recipient, i.e. details about this entity (state, ...) are sent to this player or not. See also RestrictedEntitySurface- Overrides:
serverRestrictEntityin classAbstractEntity
-
isOperational
public boolean isOperational()
Description copied from class:PhysicalEntityReturns whether the entity is ready to execute actions- Overrides:
isOperationalin classPhysicalEntity
-
enableEntity
protected void enableEntity(boolean enable)
Description copied from class:PhysicalEntityServer side: Called when the enabled state changed- Overrides:
enableEntityin classPhysicalEntity
-
getTransformedEdges
public int getTransformedEdges()
-
getCooldown
public int getCooldown()
-
setCooldown
public void setCooldown(int cooldown)
-
isCooldownDisablesEntity
public boolean isCooldownDisablesEntity()
-
setCooldownDisablesEntity
public void setCooldownDisablesEntity(boolean cooldownDisablesEntity)
-
-