|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsimulations.core.Player
public class Player
This class describes a player of the game.
Constructor Summary | |
---|---|
Player(java.lang.String name,
float hitPoints,
CompleteStrategy strategy)
Creates a new instance of Player |
|
Player(java.lang.String name,
int hitPoints)
Second constructor |
Method Summary | |
---|---|
java.lang.Object |
clone()
Returns the clone of the player |
boolean |
equals(java.lang.Object o)
overload of equals() method. |
boolean |
equals2(java.lang.Object o)
A second method to compare Players Return true if the players have same name and HP |
float |
getHitPoints()
Getter for property hitPoints. |
java.lang.String |
getName()
Getter for property name. |
CompleteStrategy |
getStrategy()
Getter for property strategy. |
void |
setHitPoints(float hitPoints)
Setter for property hitPoints. |
void |
setName(java.lang.String name)
Setter for property name. |
void |
setStrategy(CompleteStrategy strategy)
Setter for property strategy. |
java.lang.String |
toString()
overload of toString() method. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Player(java.lang.String name, float hitPoints, CompleteStrategy strategy)
name
- The name of the player.hitPoints
- The hit points of the player.strategy
- The strategy of the player.public Player(java.lang.String name, int hitPoints)
name
- The name of the player.hitPoints
- The HP of the player.Method Detail |
---|
public java.lang.String toString()
toString
in class java.lang.Object
public float getHitPoints()
public void setHitPoints(float hitPoints)
hitPoints
- New value of property hitPoints.public java.lang.String getName()
public void setName(java.lang.String name)
name
- New value of property name.public CompleteStrategy getStrategy()
public void setStrategy(CompleteStrategy strategy)
strategy
- New value of property strategy.public java.lang.Object clone()
clone
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- The object to compare.
public boolean equals2(java.lang.Object o)
o
- The object to compare.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |