Class 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 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 -
      • GameActionMessage

        public GameActionMessage​(UUID compositeEntityId,
                                 Set<UUID> entityIds,
                                 String action)
        Constructs a new GameActionMessage, addressed to multiple live entities of the same composite 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.
      • setParameters

        public void setParameters​(Map<String,​Object> parameters)
      • 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.
      • setEntityIds

        public void setEntityIds​(Set<UUID> entityIds)