java.lang.Object
games.stendhal.server.core.rp.group.Group

public class Group extends Object
A group of players
Author:
hendrik
  • Constructor Details

    • Group

      public Group()
  • Method Details

    • addMember

      public void addMember(String playerName)
      adds a member to the group
      Parameters:
      playerName - name of player
    • removeMember

      public boolean removeMember(String playerName)
      removes a member from the group
      Parameters:
      playerName - name of player
      Returns:
      true if the player was a member of this group
    • clean

      public void clean()
      removes players that are offline longer than the timeout, destroys the group if there is only one player left
    • destory

      public void destory()
      destroys the groups
    • isEmpty

      public boolean isEmpty()
      checks if this group does not have any members
      Returns:
      true, if it is empty; false if there are members in it
    • isFull

      public boolean isFull()
      checks if the group is full.
      Returns:
      true if the group is full; false otherwise
    • hasBeenInvited

      public boolean hasBeenInvited(String playerName)
      check if the player was invited
      Parameters:
      playerName - player to check if it was invited
      Returns:
      true, if the player was invited; false otherwise
    • hasLeader

      public boolean hasLeader(String playerName)
      is the specified player the leader of this group?
      Parameters:
      playerName - name of player
      Returns:
      true if its the leader; false otherwise
    • hasMember

      public boolean hasMember(String playerName)
      is the player a member of this group?
      Parameters:
      playerName - name of player
      Returns:
      true if the player is a member of this group
    • setLeader

      public boolean setLeader(String playerName)
      is the specified player the leader of this group?
      Parameters:
      playerName - name of player
      Returns:
      true if its the leader; false otherwise
    • getLootmode

      public String getLootmode()
      gets the loot mode
      Returns:
      loot mode
    • setLootmode

      public void setLootmode(String mode)
      sets the loot mode
      Parameters:
      mode - "single" or "shared"
    • invite

      public void invite(Player player, Player targetPlayer)
      invites a player to join this group.
      Parameters:
      player - player sending the invited
      targetPlayer - invited player
    • sendGroupMessage

      public void sendGroupMessage(String name, String text)
      sends a group chat message to all members
      Parameters:
      name - name of sender
      text - message to send
    • sendGroupChangeEvent

      public void sendGroupChangeEvent(Player player)
      tells the player the current status of the group
      Parameters:
      player - Player