Class PlayerGameObject


  • public abstract class PlayerGameObject
    extends GameObject
    Gameobject that can be spawned by a client
    Author:
    Darius Dinger
    • Constructor Detail

      • PlayerGameObject

        public PlayerGameObject()
    • Method Detail

      • setup

        public void setup​(String playerName,
                          boolean controlled)
        Setup player controlled game object
        Parameters:
        playerName - Name of the player who controls this object
        controlled - Is the game object controlled from this player
      • getPlayerName

        protected String getPlayerName()
        Getting the name of this player on the server. Use this as prefix for all syncronized objects and events in this gameobject!
        Returns:
        Name of this player
      • onDisconnect

        public void onDisconnect()
        Getting called when player disconnects
      • onJoin

        public void onJoin()
        Getting called, when player joines
      • isControlled

        protected boolean isControlled()
        Returns:
        Is the game object controlled by this player