Class DarkMatter
- java.lang.Object
-
- de.extio.spacecraft.shared.model.entity.AbstractCompositeEntity
-
- de.extio.spacecraft.shared.model.entity.builtin.composite.DarkMatter
-
- All Implemented Interfaces:
HasPosition2
,HasPositionAndDimension2
,SpatialIndex2Capable
public class DarkMatter extends AbstractCompositeEntity
A lump of dark matter, the mysterious (and heavy!) stuff in the game world causing different spatial effects
-
-
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 DarkMatter()
-
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.double
getGravityAccel()
double
getGravityPotential()
CoordI2
getGravityRange1()
double
getGravityRangeDist0()
double
getGravityRangeDist1()
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
onClientDraw(List<RenderingBo> renderingBo)
Client side: Draw effects related to this composite entity.void
onServerTurnPass0(GameSession gameSession)
Server side: Called every turn to contain any logic related to this entitiy.void
onServerTurnPass2(GameSession gameSession)
Server side: Called every turn to contain any logic related to this entitiy.void
setGravityAccel(double gravityAccel)
void
setGravityPotential(double gravityPotential)
void
setGravityRange1(CoordI2 gravityRange1)
void
setGravityRangeDist0(double gravityRangeDist0)
void
setGravityRangeDist1(double gravityRangeDist1)
void
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, getDynamicSerializationProperties, 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, onClientFrame, onRemove, onServerActionMessage, onServerCollision, onServerTurnPass1, 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, sumMass
-
-
-
-
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
-
onClientDraw
public void onClientDraw(List<RenderingBo> renderingBo)
Description copied from class:AbstractCompositeEntity
Client side: Draw effects related to this composite entity. All entities are already drawn separately by the game core.- Overrides:
onClientDraw
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
-
onServerTurnPass2
public void onServerTurnPass2(GameSession gameSession)
Description copied from class:AbstractCompositeEntity
Server side: Called every turn to contain any logic related to this entitiy. Pass2 is called after pass1 was called on all composites.- Overrides:
onServerTurnPass2
in classAbstractCompositeEntity
-
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
-
getGravityRangeDist0
public double getGravityRangeDist0()
-
setGravityRangeDist0
public void setGravityRangeDist0(double gravityRangeDist0)
-
getGravityRangeDist1
public double getGravityRangeDist1()
-
setGravityRangeDist1
public void setGravityRangeDist1(double gravityRangeDist1)
-
getGravityRange1
public CoordI2 getGravityRange1()
-
setGravityRange1
public void setGravityRange1(CoordI2 gravityRange1)
-
getGravityPotential
public double getGravityPotential()
-
setGravityPotential
public void setGravityPotential(double gravityPotential)
-
getGravityAccel
public double getGravityAccel()
-
setGravityAccel
public void setGravityAccel(double gravityAccel)
-
-