|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdip.world.Power
A Power represents player in the game.
Constructor Summary | |
Power(java.lang.String[] names,
java.lang.String adjective,
boolean isActive)
Create a new Power. |
Method Summary | |
int |
compareTo(java.lang.Object obj)
Implementation of Comparable interface |
java.lang.String |
getAdjective()
Returns the adjective of the power (e.g., power France, adjective is French) |
java.lang.String |
getName()
Returns the name of the power. |
java.lang.String[] |
getNames()
Get all names. |
int |
hashCode()
Implementation of Object.hashCode() |
boolean |
isActive()
Determines if this power is active. |
java.lang.String |
toString()
Implementation of Object.toString() |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Power(java.lang.String[] names, java.lang.String adjective, boolean isActive)
The first name in the names array (index position 0) must be the full display name of the power. Names beyond index 0 are optional, and are "alternate" names (e.g., "Britain" instead of "England").
All fields are required and must be non-null/non-zero-length; Names (not adjectives) should not contain whitespace, and must not be empty ("") or null.
This should generally not be used, except for when a game is first created. Note that Power uses instance equality, so two Power() objects created with the same arguments will NOT be the same.
Method Detail |
public java.lang.String getName()
public java.lang.String getAdjective()
public java.lang.String[] getNames()
public boolean isActive()
public int hashCode()
public java.lang.String toString()
public int compareTo(java.lang.Object obj)
compareTo
in interface java.lang.Comparable
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |