org.vizzini.game
Interface IToken

All Superinterfaces:
Cloneable, Serializable
All Known Subinterfaces:
IBishop, IBoardGameToken, ICard, IChessToken, IKing, IKnight, IMace, IPawn, IPhysicalObject, IQueen, IRook
All Known Implementing Classes:
AbstractCard, AbstractChessToken, AbstractPhysicalObject, AbstractToken, Ball, Bishop, DefaultBoardGameToken, DefaultPhysicalObject, DefaultToken, King, Knight, Mace, Paddle, Pawn, PokerCard, Queen, Rook

public interface IToken
extends Cloneable, Serializable

Defines methods required by tokens in the game framework. A token instance encapsulates the different types and behavior of game tokens.

Since:
v0.1
Version:
v0.3
Author:
Jeffrey M. Thompson

Field Summary
static String AGENT_PROPERTY
          Agent property name.
static String NAME_PROPERTY
          Name property name.
static String POSITION_PROPERTY
          Position property name.
static String TEAM_PROPERTY
          Team property name.
 
Method Summary
 void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
          Add a PropertyChangeListener for a specific property.
 Object clone()
          Return a clone of this instance.
 void configure(Properties properties, int index)
          Configure this token.
 IAgent getAgent()
          Return this token's agent.
 int getIndex()
           
 String getName()
          Return this token's name.
 IPosition getPosition()
          Return the position.
 ITeam getTeam()
          Return this token's team.
 int getValue()
          Return the value of this token.
 void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)
          Remove a PropertyChangeListener for a specific property.
 void setAgent(IAgent agent)
          Set the associated agent.
 void setName(String name)
          Set the name to the given value.
 void setPosition(IPosition position)
          Set the position.
 void setTeam(ITeam team)
          Set the associated team.
 void setValue(int value)
          Set the value of this token.
 

Field Detail

POSITION_PROPERTY

static final String POSITION_PROPERTY
Position property name.

See Also:
Constant Field Values

NAME_PROPERTY

static final String NAME_PROPERTY
Name property name.

See Also:
Constant Field Values

AGENT_PROPERTY

static final String AGENT_PROPERTY
Agent property name.

See Also:
Constant Field Values

TEAM_PROPERTY

static final String TEAM_PROPERTY
Team property name.

See Also:
Constant Field Values
Method Detail

getIndex

int getIndex()
Returns:
Return index.
Since:
v0.3

addPropertyChangeListener

void addPropertyChangeListener(String propertyName,
                               PropertyChangeListener listener)
Add a PropertyChangeListener for a specific property. The listener will be invoked only when a call on firePropertyChange names that specific property.

Parameters:
propertyName - The name of the property to listen on.
listener - The PropertyChangeListener to be added.
Since:
v0.2

clone

Object clone()
Return a clone of this instance.

Since:
v0.1

configure

void configure(Properties properties,
               int index)
Configure this token.

Parameters:
properties - Source of configuration information.
index - Index of this token's properties.
Since:
v0.1

getAgent

IAgent getAgent()
Return this token's agent.

Since:
v0.1

getName

String getName()
Return this token's name.

Since:
v0.1

getPosition

IPosition getPosition()
Return the position.

Since:
v0.1

getTeam

ITeam getTeam()
Return this token's team.

Since:
v0.1

getValue

int getValue()
Return the value of this token.

Since:
v0.1

removePropertyChangeListener

void removePropertyChangeListener(String propertyName,
                                  PropertyChangeListener listener)
Remove a PropertyChangeListener for a specific property.

Parameters:
propertyName - The name of the property that was listened on.
listener - The PropertyChangeListener to be removed.
Since:
v0.2

setAgent

void setAgent(IAgent agent)
Set the associated agent.

Parameters:
agent - The associated agent.
Since:
v0.1

setName

void setName(String name)
Set the name to the given value.

Parameters:
name - The new name.
Since:
v0.1

setPosition

void setPosition(IPosition position)
Set the position.

Since:
v0.1

setTeam

void setTeam(ITeam team)
Set the associated team.

Parameters:
team - The associated team.
Since:
v0.1

setValue

void setValue(int value)
Set the value of this token.

Parameters:
value - The new value.
Since:
v0.1


Copyright 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02