Class ImageSurfaceCompositeEntity
- java.lang.Object
-
- de.extio.spacecraft.shared.model.entity.AbstractCompositeEntity
-
- de.extio.spacecraft.shared.model.entity.builtin.composite.ImageSurfaceCompositeEntity
-
- All Implemented Interfaces:
HasPosition2
,HasPositionAndDimension2
,SpatialIndex2Capable
- Direct Known Subclasses:
AbstractAiSpawnPortal
,AbstractPortalCompositeEntity
public class ImageSurfaceCompositeEntity extends AbstractCompositeEntity
Image surfaces are showing an area of a tileset in the game world
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class de.extio.spacecraft.shared.model.entity.AbstractCompositeEntity
AbstractCompositeEntity.CollisionCalculationResult, AbstractCompositeEntity.DefaultDamageWaveDamageHandler
-
-
Field Summary
Fields Modifier and Type Field Description protected double
serverDampenVelocityFactor
protected boolean
serverSurfaceBuilt
-
Fields inherited from class de.extio.spacecraft.shared.model.entity.AbstractCompositeEntity
accelerationVector, DAMAGE_COLORS, DAMAGE_CONSUMER_BOTH, DAMAGE_CONSUMER_ENTITY, DAMAGE_CONSUMER_SHIELD, DAMAGEWAVE_DIRECTIONS, dimension, dirty, entityManager, fields, fresh, lastMovement, LOGGER, meshes, position, positionDirty, precisePosition, prevPosition, prevVelocityVector, ROTATE_COLLISION_COLOR, splitEntityGroups, sumMassCached, sumMassCachedTurn, uuid, velocityVector, VMAX_M_LB, VMAX_M_UB, VMAX_VEL_MAX, VMAX_VEL_MIN, VMAX_VEL_VAR
-
-
Constructor Summary
Constructors Constructor Description ImageSurfaceCompositeEntity()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
create(UUID uuid, CoordI2 position, CoordI2 dimension)
Called upon initial creation of this composite entity.void
damageWave(GameSession gameSession, DamageWaveOptions damageWaveOptions, List<AbstractEntity> damagedEntities)
Distributes incoming damage on entities.
There are certain aspects relevant for the calculation:
* A tiles consists of several layered entities
* An entity only absorbs a certain amount of damage (plateaus), which is also dependent on the weapon
* A tile can be protected by shields
* Also shields have plateaus
* Damage that is not absorbed propagates to nearby tiles
* Damage cannot propagate through some tiles in certain directions, i.e.Map<String,Object>
getDynamicSerializationProperties(boolean incremental, UUID recipient)
Dynamic serialization properties are created when transferring data from server to client (or vice versa) as well as when persisting a composite to disk.Area2
getTilesetArea()
String
getTilesetModName()
String
getTilesetName()
boolean
isDestructible()
boolean
isEditorParametersDirty()
void
localCopy(AbstractCompositeEntity other)
Local copy of all fields that are not covered by update()void
localInit(EntityManager entityManager)
Local initialization of transient fields.void
onServerTurnPass0(GameSession gameSession)
Server side: Called every turn to contain any logic related to this entitiy.protected AbstractCompositeEntity.CollisionCalculationResult
priorityCalculateCollision(Map.Entry<AbstractCompositeEntity,List<AbstractEntity>> collisionPartner)
Overrides the regular collision calculationvoid
serverBuildSurface(GameSession gameSession)
protected void
serverDampenVelocity()
void
serverResetSurface()
void
setDestructible(boolean destructible)
void
setDynamicSerializationProperties(Map<String,Object> properties)
This is the counterpart of getDynamicSerializationProperties(), see the description there.void
setEditorParametersDirty(boolean editorParametersDirty)
void
setTilesetArea(Area2 tilesetArea)
void
setTilesetModName(String tilesetModName)
void
setTilesetName(String tilesetName)
double
sumMass()
Sums up the total mass of this compositevoid
update(AbstractCompositeEntity other)
Updates non-transient fields (i.e.-
Methods inherited from class de.extio.spacecraft.shared.model.entity.AbstractCompositeEntity
accelerate, calculateCollision, calculateVMax, compressDimension, excludeDynamicSerializationPropertiesPermanentStorage, getAccelerationVector, getAnimationOffset, getCompositeEntityFactoryClassName, getDimension, getDynamicSerializationPropertiesForSeparateTransfer, getEntityManager, getEntityNetworkConsolesCache, getFields, getLastEdited, getLastRotation, getLastRotationDirection, getMeshes, getPosition, getPrecisePosition, getPrevPosition, getSceneTag, getServerFieldsLastPublished, getServerLastInViewPort, getServerMeshesLastPublished, getServerScannedBy, getUuid, getVelocityVector, handleMove, handleMoveApply, includeInSpatialIndex2ResultSet, isDirty, isFresh, isInSpatialIndex2ResultSet, isLocalInit, isPositionDirty, isRemoved, isShadowed, isSplitEntityGroups, onClientActionMessage, onClientDraw, onClientFrame, onRemove, onServerActionMessage, onServerCollision, onServerTurnPass1, onServerTurnPass2, resetFieldsForPermanentStorage, resetStatic, restoreFieldsFromPermanentStorage, rotate, setAccelerationVector, setCompositeEntityFactoryClassName, setDimension, setDirty, setEntityManager, setFresh, setLastEdited, setPosition, setPositionDirty, setPrecisePosition, setPrevPosition, setSceneTag, setServerFieldsLastPublished, setServerMeshesLastPublished, setShadowed, setSplitEntityGroups, setUuid, setVelocityVector, splitEntityGroups
-
-
-
-
Method Detail
-
create
public void create(UUID uuid, CoordI2 position, CoordI2 dimension)
Description copied from class:AbstractCompositeEntity
Called upon initial creation of this composite entity. This method is not called locally (i.e. when the composite has been transferred from server to client), so only initialize non-transient fields here. See also localInit()- Overrides:
create
in classAbstractCompositeEntity
-
update
public void update(AbstractCompositeEntity other)
Description copied from class:AbstractCompositeEntity
Updates non-transient fields (i.e. when receiving an entity update from server or copying a composite entity)- Overrides:
update
in classAbstractCompositeEntity
-
localInit
public void localInit(EntityManager entityManager)
Description copied from class:AbstractCompositeEntity
Local initialization of transient fields. See also create() and update()- Overrides:
localInit
in classAbstractCompositeEntity
-
localCopy
public void localCopy(AbstractCompositeEntity other)
Description copied from class:AbstractCompositeEntity
Local copy of all fields that are not covered by update()- Overrides:
localCopy
in classAbstractCompositeEntity
-
getDynamicSerializationProperties
public Map<String,Object> getDynamicSerializationProperties(boolean incremental, UUID recipient)
Description copied from class:AbstractCompositeEntity
Dynamic serialization properties are created when transferring data from server to client (or vice versa) as well as when persisting a composite to disk. These properties provide a way to implement complex serialization logic (i.e. views) and to distinguish between incremental and full updates.- Overrides:
getDynamicSerializationProperties
in classAbstractCompositeEntity
-
setDynamicSerializationProperties
public void setDynamicSerializationProperties(Map<String,Object> properties)
Description copied from class:AbstractCompositeEntity
This is the counterpart of getDynamicSerializationProperties(), see the description there.- Overrides:
setDynamicSerializationProperties
in classAbstractCompositeEntity
-
onServerTurnPass0
public void onServerTurnPass0(GameSession gameSession)
Description copied from class:AbstractCompositeEntity
Server side: Called every turn to contain any logic related to this entitiy. Pass0 is called at the beginning of the cycle before entity callbacks have been called.- Overrides:
onServerTurnPass0
in classAbstractCompositeEntity
-
serverBuildSurface
public void serverBuildSurface(GameSession gameSession)
-
serverResetSurface
public void serverResetSurface()
-
serverDampenVelocity
protected void serverDampenVelocity()
-
damageWave
public void damageWave(GameSession gameSession, DamageWaveOptions damageWaveOptions, List<AbstractEntity> damagedEntities)
Description copied from class:AbstractCompositeEntity
Distributes incoming damage on entities.
There are certain aspects relevant for the calculation:
* A tiles consists of several layered entities
* An entity only absorbs a certain amount of damage (plateaus), which is also dependent on the weapon
* A tile can be protected by shields
* Also shields have plateaus
* Damage that is not absorbed propagates to nearby tiles
* Damage cannot propagate through some tiles in certain directions, i.e. walls, unless the entity is destroyed
* Propagated damage is dampened
* Damage handlers for tiles are pluggable- Overrides:
damageWave
in classAbstractCompositeEntity
-
priorityCalculateCollision
protected AbstractCompositeEntity.CollisionCalculationResult priorityCalculateCollision(Map.Entry<AbstractCompositeEntity,List<AbstractEntity>> collisionPartner)
Description copied from class:AbstractCompositeEntity
Overrides the regular collision calculation- Overrides:
priorityCalculateCollision
in classAbstractCompositeEntity
-
sumMass
public double sumMass()
Description copied from class:AbstractCompositeEntity
Sums up the total mass of this composite- Overrides:
sumMass
in classAbstractCompositeEntity
-
setDestructible
public void setDestructible(boolean destructible)
-
getTilesetModName
public String getTilesetModName()
-
setTilesetModName
public void setTilesetModName(String tilesetModName)
-
getTilesetName
public String getTilesetName()
-
setTilesetName
public void setTilesetName(String tilesetName)
-
getTilesetArea
public Area2 getTilesetArea()
-
setTilesetArea
public void setTilesetArea(Area2 tilesetArea)
-
isEditorParametersDirty
public boolean isEditorParametersDirty()
-
setEditorParametersDirty
public void setEditorParametersDirty(boolean editorParametersDirty)
-
isDestructible
public boolean isDestructible()
-
-