Class InfoCompositeEntity
- java.lang.Object
-
- de.extio.spacecraft.shared.model.entity.AbstractCompositeEntity
-
- de.extio.spacecraft.shared.model.entity.builtin.composite.InfoCompositeEntity
-
- All Implemented Interfaces:
HasPosition2
,HasPositionAndDimension2
,SpatialIndex2Capable
- Direct Known Subclasses:
ScriptingCompositeEntity
public class InfoCompositeEntity extends AbstractCompositeEntity
InfoCompositeEntity is non-physical and mainly used as container for markers and scripts
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class de.extio.spacecraft.shared.model.entity.AbstractCompositeEntity
AbstractCompositeEntity.CollisionCalculationResult, AbstractCompositeEntity.DefaultDamageWaveDamageHandler
-
-
Field Summary
-
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 InfoCompositeEntity()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accelerate(CoordD2 a)
Accelerates 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.InfoEntity
getInfoEntityCached()
Class<? extends InfoEntity>
getInfoTypeCached()
protected void
handleMove(GameSession gameSession)
Server side: Called on every turn twice (pass0 and pass1) to handle movement of this compositevoid
localInit(EntityManager entityManager)
Local initialization of transient fields.protected boolean
onServerCollision(GameSession gameSession, Map<AbstractCompositeEntity,List<AbstractEntity>> entityLevelCollisions)
Server side: Callback for additional logic when a collision happened<T extends InfoEntity>
Tsetup(Class<T> clazz, Class<? extends AbstractEntityDef> entityDefType)
double
sumMass()
Sums up the total mass of this composite-
Methods inherited from class de.extio.spacecraft.shared.model.entity.AbstractCompositeEntity
calculateCollision, calculateVMax, compressDimension, create, excludeDynamicSerializationPropertiesPermanentStorage, getAccelerationVector, getAnimationOffset, getCompositeEntityFactoryClassName, getDimension, getDynamicSerializationProperties, getDynamicSerializationPropertiesForSeparateTransfer, getEntityManager, getEntityNetworkConsolesCache, getFields, getLastEdited, getLastRotation, getLastRotationDirection, getMeshes, getPosition, getPrecisePosition, getPrevPosition, getSceneTag, getServerFieldsLastPublished, getServerLastInViewPort, getServerMeshesLastPublished, getServerScannedBy, getUuid, getVelocityVector, handleMoveApply, includeInSpatialIndex2ResultSet, isDirty, isFresh, isInSpatialIndex2ResultSet, isLocalInit, isPositionDirty, isRemoved, isShadowed, isSplitEntityGroups, localCopy, onClientActionMessage, onClientDraw, onClientFrame, onRemove, onServerActionMessage, onServerTurnPass0, onServerTurnPass1, onServerTurnPass2, priorityCalculateCollision, resetFieldsForPermanentStorage, resetStatic, restoreFieldsFromPermanentStorage, rotate, setAccelerationVector, setCompositeEntityFactoryClassName, setDimension, setDirty, setDynamicSerializationProperties, setEntityManager, setFresh, setLastEdited, setPosition, setPositionDirty, setPrecisePosition, setPrevPosition, setSceneTag, setServerFieldsLastPublished, setServerMeshesLastPublished, setShadowed, setSplitEntityGroups, setUuid, setVelocityVector, splitEntityGroups, update
-
-
-
-
Method Detail
-
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
-
sumMass
public double sumMass()
Description copied from class:AbstractCompositeEntity
Sums up the total mass of this composite- Overrides:
sumMass
in classAbstractCompositeEntity
-
handleMove
protected void handleMove(GameSession gameSession)
Description copied from class:AbstractCompositeEntity
Server side: Called on every turn twice (pass0 and pass1) to handle movement of this composite- Overrides:
handleMove
in classAbstractCompositeEntity
-
onServerCollision
protected boolean onServerCollision(GameSession gameSession, Map<AbstractCompositeEntity,List<AbstractEntity>> entityLevelCollisions)
Description copied from class:AbstractCompositeEntity
Server side: Callback for additional logic when a collision happened- Overrides:
onServerCollision
in classAbstractCompositeEntity
-
accelerate
public void accelerate(CoordD2 a)
Description copied from class:AbstractCompositeEntity
Accelerates composite entity. Implements a speed limit based on mass. (I'm aware that in reality there is nothing like that in space well below relativistic levels - this is purely implemented because of gameplay considerations. Almost no space game allows to accelerate indefinitely!)- Overrides:
accelerate
in classAbstractCompositeEntity
- Parameters:
a
- Acceleration vector
-
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
-
setup
public <T extends InfoEntity> T setup(Class<T> clazz, Class<? extends AbstractEntityDef> entityDefType)
-
getInfoTypeCached
public Class<? extends InfoEntity> getInfoTypeCached()
-
getInfoEntityCached
public InfoEntity getInfoEntityCached()
-
-