|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectclient.framework.models.AbstractPlayer
client.brickblock.fwimpl.BBPlayer
public class BBPlayer
BrickBlock's AbstractPlayer
implemention.
In addition to the attributes and functionality found
in AbstractPlayer
, this class contains
information about the player's strength and screen
resolution. In addition, this class offers
functionality for handling a player's bonuses in terms
of active Powerup
objects.
Constructor Summary | |
---|---|
BBPlayer(java.lang.String id)
Yet another constructor that creates a nameless player. |
|
BBPlayer(java.lang.String id,
java.lang.String name)
Constructor that corresponds to the super constructor. |
|
BBPlayer(java.lang.String id,
java.lang.String name,
int strength)
Constructor for BBPlayer . |
Method Summary | |
---|---|
int |
getStrength()
Returns the player's strength. |
void |
pickupPowerup(Powerup powerup)
Called when the player picks up a Powerup
object. |
void |
removePowerup(java.lang.String type,
int posX,
int posY)
Deactivates the power up indicated by given attributes and removes it from the player object's list of active power ups. |
void |
setStrength(int strength)
Sets the player's strength to the value given as input parameter. |
Methods inherited from class client.framework.models.AbstractPlayer |
---|
compareTo, equals, getAttributeValues, getColor, getId, getName, getPosition, getScore, getScreenResolution, getSize, getSpeed, getSprite, getTeam, isReady, move, move, resetMovement, setAttributeValues, setColor, setImage, setName, setPosition, setReady, setScore, setScreenResolution, setSize, setSpeed, setTeam, setTeamColor, setX, setY, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public BBPlayer(java.lang.String id, java.lang.String name, int strength)
BBPlayer
. This contructor takes
the player's strength as input parameter in addition
to the parameters from the super constructor.
id
- The player's network id.name
- The player's name.strength
- The player's strength.public BBPlayer(java.lang.String id, java.lang.String name)
BBPlayer
objects with a default
strength of 2.
id
- The player's id.name
- The player's name.public BBPlayer(java.lang.String id)
id
- The player's id.Method Detail |
---|
public int getStrength()
public void setStrength(int strength)
strength
- The player's strength.public void pickupPowerup(Powerup powerup)
Powerup
object. The power up is activated, and remains active
until the server notifies that the power up has been
deactivated.
powerup
- The Powerup
picked up.BBBoard.handleObjectCollision(Object, int[])
public void removePowerup(java.lang.String type, int posX, int posY)
type
- The power up type.posX
- The horizontal position of the power up.posY
- The vertical position of the power up.BrickBlock.notifyAboutSpecialActionReceived(client.framework.models.AbstractPlayer, String, String[][])
,
Powerup.getPowerUpName()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |