Class LootContainerCompositeEntity
- java.lang.Object
-
- de.extio.spacecraft.shared.model.entity.AbstractCompositeEntity
-
- de.extio.spacecraft.shared.model.entity.builtin.composite.LootContainerCompositeEntity
-
- All Implemented Interfaces:
HasPosition2
,HasPositionAndDimension2
,SpatialIndex2Capable
public class LootContainerCompositeEntity extends AbstractCompositeEntity
Loot containers are spawned by LootScatterer and contain loot that can be collected with a LootCollectorEntity
-
-
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 LootContainerCompositeEntity()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
collect(GameSession gameSession)
void
create(UUID uuid, CoordI2 position, CoordI2 dimension)
Called upon initial creation of this composite entity.CompositeAndEntityId
getCollectedBy()
UUID
getDroppedBy()
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.int
getReservedTurns()
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.protected boolean
onServerCollision(GameSession gameSession, Map<AbstractCompositeEntity,List<AbstractEntity>> entityLevelCollisions)
Server side: Callback for additional logic when a collision happenedvoid
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
reserve(CompositeAndEntityId collectBy, GameSession gameSession)
void
setCollectedBy(CompositeAndEntityId collectedBy)
void
setDroppedBy(UUID droppedBy)
void
setDynamicSerializationProperties(Map<String,Object> properties)
This is the counterpart of getDynamicSerializationProperties(), see the description there.void
setReservedTurns(int reservedTurns)
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, damageWave, 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, onClientFrame, onRemove, onServerActionMessage, 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, 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
-
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
-
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
-
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
-
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
-
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
-
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
-
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
-
reserve
public void reserve(CompositeAndEntityId collectBy, GameSession gameSession)
-
collect
public boolean collect(GameSession gameSession)
-
getCollectedBy
public CompositeAndEntityId getCollectedBy()
-
setCollectedBy
public void setCollectedBy(CompositeAndEntityId collectedBy)
-
getReservedTurns
public int getReservedTurns()
-
setReservedTurns
public void setReservedTurns(int reservedTurns)
-
getDroppedBy
public UUID getDroppedBy()
-
setDroppedBy
public void setDroppedBy(UUID droppedBy)
-
-