Class Player

All Implemented Interfaces:
IEntity, RPObjectChangeListener
Direct Known Subclasses:
User

public class Player extends RPEntity
A Player entity.
  • Field Details

    • PROP_AWAY

      public static final games.stendhal.client.entity.Property PROP_AWAY
      Away property.
    • PROP_GRUMPY

      public static final games.stendhal.client.entity.Property PROP_GRUMPY
      Grumpy property.
    • PROP_PLAYER_KILLER

      public static final games.stendhal.client.entity.Property PROP_PLAYER_KILLER
      Player killer property.
  • Constructor Details

    • Player

      public Player()
      Create a player entity.
  • Method Details

    • isAway

      public boolean isAway()
      Determine if the player is away.
      Returns:
      true if the player is away.
    • isBadBoy

      public boolean isBadBoy()
    • getAway

      public String getAway()
      Get the away message.
      Returns:
      The away text, or null if not away.
    • onAway

      protected void onAway(String message)
      An away message was set/cleared.
      Parameters:
      message - The away message, or null if no-longer away.
    • isGrumpy

      public boolean isGrumpy()
      Determine if the player is grumpy.
      Returns:
      true if the player is grumpy.
    • onTalk

      public void onTalk(String text)
      Description copied from class: RPEntity
      Called when entity says something.
      Overrides:
      onTalk in class RPEntity
      Parameters:
      text - message contents
    • onChangedAdded

      public void onChangedAdded(RPObject object, RPObject changes)
      The object added/changed attribute(s).
      Specified by:
      onChangedAdded in interface RPObjectChangeListener
      Overrides:
      onChangedAdded in class RPEntity
      Parameters:
      object - The base object.
      changes - The changes.
    • onChangedRemoved

      public void onChangedRemoved(RPObject object, RPObject changes)
      The object removed attribute(s).
      Specified by:
      onChangedRemoved in interface RPObjectChangeListener
      Overrides:
      onChangedRemoved in class RPEntity
      Parameters:
      object - The base object.
      changes - The changes.
    • addSounds

      protected void addSounds(String groupName, String categoryName, String... soundNames)
    • onPosition

      protected void onPosition(double x, double y)
      Description copied from class: Entity
      When the entity's position changed.
      Overrides:
      onPosition in class Entity
      Parameters:
      x - The new X coordinate.
      y - The new Y coordinate.
    • playRandomSoundFromCategory

      protected void playRandomSoundFromCategory(String groupName, String categoryName)
    • playRandomSoundFromGroup

      protected void playRandomSoundFromGroup(String groupName, String categoryName, long waitTimeInMilliSec)
    • playSoundFromCategory

      protected void playSoundFromCategory(String groupName, String categoryName)
    • playSoundFromCategory

      protected void playSoundFromCategory(String groupName, String categoryName, int index)