Class GameActionMessage
- java.lang.Object
-
- de.extio.spacecraft.shared.model.message.AbstractMessage
-
- de.extio.spacecraft.shared.model.message.toboth.GameActionMessage
-
public final class GameActionMessage extends AbstractMessage
GameActionMessage is the preferred way to exchange any kind of information between client and server (and vice versa) that is related to game logic
-
-
Constructor Summary
Constructors Constructor Description GameActionMessage()
GameActionMessage(String action)
Constructs a new GameActionMessage, addressed to a moduleGameActionMessage(UUID compositeEntityId, String action)
Constructs a new GameActionMessage, addressed to a composite entityGameActionMessage(UUID compositeEntityId, Set<UUID> entityIds, String action)
Constructs a new GameActionMessage, addressed to multiple live entities of the same composite entity.GameActionMessage(UUID compositeEntityId, UUID entityId, String action)
Constructs a new GameActionMessage, addressed to a live entity
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getAction()
Free text qualifier that identifies the kind of informationArea2
getArea()
If set, the game action message will be delivered to all players that have vision in that area (world coordinates).UUID
getCompositeEntityId()
If set, the message will be delivered to the event callback of this composite entityUUID
getEntityId()
If set, the message will be delivered to the event callback of this entity.Set<UUID>
getEntityIds()
If set, the message will be delivered to the event callback of these entities.Map<String,Object>
getParameters()
Parameters are flexible name-value pairs to add additional information.UUID
getPlayerId()
Set by the game server, the player id that has sent this messageboolean
isPublish()
When send from the client to the server, the server will immediately re-publish this game action message to all clientsvoid
setAction(String action)
void
setArea(Area2 area)
void
setCompositeEntityId(UUID compositeEntityId)
void
setEntityId(UUID entityId)
void
setEntityIds(Set<UUID> entityIds)
void
setParameters(Map<String,Object> parameters)
void
setPlayerId(UUID playerId)
void
setPublish(boolean publish)
String
toString()
-
-
-
Constructor Detail
-
GameActionMessage
public GameActionMessage()
-
GameActionMessage
public GameActionMessage(String action)
Constructs a new GameActionMessage, addressed to a module- Parameters:
compositeEntityId
-action
-
-
GameActionMessage
public GameActionMessage(UUID compositeEntityId, String action)
Constructs a new GameActionMessage, addressed to a composite entity- Parameters:
compositeEntityId
-action
-
-
GameActionMessage
public GameActionMessage(UUID compositeEntityId, UUID entityId, String action)
Constructs a new GameActionMessage, addressed to a live entity- Parameters:
compositeEntityId
-entityId
-action
-
-
-
Method Detail
-
getAction
public String getAction()
Free text qualifier that identifies the kind of information
-
setAction
public void setAction(String action)
-
getParameters
public Map<String,Object> getParameters()
Parameters are flexible name-value pairs to add additional information. It is recommended to only use primitive java types as values.
-
getCompositeEntityId
public UUID getCompositeEntityId()
If set, the message will be delivered to the event callback of this composite entity
-
setCompositeEntityId
public void setCompositeEntityId(UUID compositeEntityId)
-
getEntityId
public UUID getEntityId()
If set, the message will be delivered to the event callback of this entity. compositeEntityId must also be set.
-
setEntityId
public void setEntityId(UUID entityId)
-
isPublish
public boolean isPublish()
When send from the client to the server, the server will immediately re-publish this game action message to all clients
-
setPublish
public void setPublish(boolean publish)
-
getPlayerId
public UUID getPlayerId()
Set by the game server, the player id that has sent this message
-
setPlayerId
public void setPlayerId(UUID playerId)
-
getArea
public Area2 getArea()
If set, the game action message will be delivered to all players that have vision in that area (world coordinates).
-
setArea
public void setArea(Area2 area)
-
getEntityIds
public Set<UUID> getEntityIds()
If set, the message will be delivered to the event callback of these entities. compositeEntityId must also be set.
-
toString
public String toString()
- Overrides:
toString
in classAbstractMessage
-
-