wyvern.kernel.player
Class PlayerGroups.Group

java.lang.Object
  extended bywyvern.kernel.player.PlayerGroups.Group
Enclosing class:
PlayerGroups

public static class PlayerGroups.Group
extends java.lang.Object

Tracks a single group.


Constructor Summary
PlayerGroups.Group()
           
 
Method Summary
 void addMember(java.lang.String name)
          Adds a member.
 boolean contains(Player p)
          Returns true if the group contains the specified player, either as a member or the leader.
 boolean containsMember(java.lang.String name)
          Returns true if the specified player is a member of the group.
 java.lang.String getGroupName()
          Returns the name of the group.
 java.lang.String getLeader()
           
 java.util.Set getMembers()
          Returns the people in the group.
 boolean isEmpty()
          Returns true if there are no members in the group.
 boolean isLeader(Player p)
          Returns true if this player is leading the group.
 void message(java.lang.String msg)
          Sends a message to everyone in the group, including the group leader.
 void removeMember(java.lang.String name)
          Removes a member from the group.
 void setGroupName(java.lang.String name)
          Sets the name for the group.
 void setLeader(java.lang.String name)
          Sets the leader for the group.
 java.lang.String toString()
          Prints the members of the group.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PlayerGroups.Group

public PlayerGroups.Group()
Method Detail

getMembers

public java.util.Set getMembers()
Returns the people in the group.


isEmpty

public boolean isEmpty()
Returns true if there are no members in the group. (The leader doesn't count as a member).


contains

public boolean contains(Player p)
Returns true if the group contains the specified player, either as a member or the leader.


addMember

public void addMember(java.lang.String name)
Adds a member.

Parameters:
name - the player name, case-insensitive

removeMember

public void removeMember(java.lang.String name)
Removes a member from the group.

Parameters:
name - the player name, case-insensitive

containsMember

public boolean containsMember(java.lang.String name)
Returns true if the specified player is a member of the group.

Parameters:
name - the player name, case-insensitive

setLeader

public void setLeader(java.lang.String name)
Sets the leader for the group.

Parameters:
name - the new leader, case-insensitive

getLeader

public java.lang.String getLeader()

isLeader

public boolean isLeader(Player p)
Returns true if this player is leading the group.


toString

public java.lang.String toString()
Prints the members of the group.


message

public void message(java.lang.String msg)
Sends a message to everyone in the group, including the group leader.


setGroupName

public void setGroupName(java.lang.String name)
Sets the name for the group.


getGroupName

public java.lang.String getGroupName()
Returns the name of the group.