com.huguesjohnson.tiamat
Class Party

java.lang.Object
  extended by com.huguesjohnson.tiamat.Party

public class Party
extends java.lang.Object

Party - a collection of Characters

Author:
Hugues Johnson

Constructor Summary
Party()
          Creates an empty Party.
Party(PlayerCharacter character)
          Creates a Party with a single member.
 
Method Summary
 void add(PlayerCharacter character)
          Adds a character to the end of the Party.
 PlayerCharacter getMember(int index)
          Returns the character at index, null if index<0 || index>=getMemberCount().
 int getMemberCount()
          Returns the number of characters in this Party.
 Character[] getMembers()
          Returns the members (Characters) in the Party.
 Character remove(int index)
          Removes and returns the character at the specified index.
 void setMembers(Character[] members)
          Sets the members in the Party.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Party

public Party()
Creates an empty Party.


Party

public Party(PlayerCharacter character)
Creates a Party with a single member.

Parameters:
character - The single member of the Party.
Method Detail

getMembers

public Character[] getMembers()
Returns the members (Characters) in the Party.

Returns:
The members (Characters) in the Party.

setMembers

public void setMembers(Character[] members)
Sets the members in the Party.

Parameters:
members - The new members in the Party.

getMemberCount

public int getMemberCount()
Returns the number of characters in this Party.

Returns:
The number of characters in this Party.

getMember

public PlayerCharacter getMember(int index)
Returns the character at index, null if index<0 || index>=getMemberCount().

Returns:
The character at index, null if index<0 || index>=getMemberCount().

add

public void add(PlayerCharacter character)
Adds a character to the end of the Party.

Parameters:
character - The Character to add.

remove

public Character remove(int index)
Removes and returns the character at the specified index. Moves members down as needed. Returns null if index<0 || index>=getMemberCount().

Parameters:
index - The index of the Character to remove.
Returns:
The Character that was removed, null if index<0 || index>=getMemberCount().


Copyright © 2004-2006 Hugues Johnson