This class represents a player. More...
#include <Player.h>
Classes | |
struct | PlayerGameData |
Player data that needs to be reset every game should go here. | |
struct | PlayerPowerupData |
Player data used when a powerup is in effect. | |
Public Member Functions | |
void | IncrementCycle () |
Rotate the TetriCycle base to the right. | |
void | DecrementCycle () |
Rotate the TetriCycle base to the left. | |
void | Reset () |
Reset all state associated with this player. | |
int | GetPowerupQueueSlot () |
Get an open slot for storing an acquired powerup. | |
void | QueuePowerup (Powerup *powerup, int slot) |
Adds the acquired powerup to the powerup queue. | |
void | RemovePowerup (int slot) |
Removes an acquired powerup from the powerup queue. | |
int | GetEffectQueueSlot () |
Get an open slot for storing a powerup effect. | |
bool | QueueEffect (Powerup *powerup) |
Adds a powerup to the powerup effect queue. | |
void | QueueEffect (Powerup *powerup, int slot) |
Queue a powerup effect at the specified slot. | |
bool | RemoveEffect (Powerup *powerup) |
Removes a powerup from the powerup effect queue. | |
void | Update () |
Updates the player state. | |
void | DrawPlayfield () |
Draw the playfield (all the static tetris pieces). | |
void | DrawPiece (TetrisPiece *cp=NULL, u8 alpha=255) |
Draws a tetris piece. | |
void | DrawPieceShadow () |
Draw where the current piece will end up if dropped. | |
void | DrawNextPiece () |
Draw the next piece. | |
void | DrawBase () |
Draw the base of the TetriCycle. | |
void | RotateCurrentPiece (int rot) |
Rotate the current piece. | |
bool | MovePlayfield (int type) |
Move the playfield. | |
bool | MovePiece (int type, TetrisPiece *cp=NULL) |
Moves the tetris piece in the given direction. | |
void | DoMovement () |
Move the current piece down automatically. | |
void | DrawBlockAsCube (float x, float y, ColorId colorIdx, u8 alpha=255, GuiImageData *imgData=NULL, bool isGuideDot=false) |
Draw each tetris piece block as a cube. | |
Public Attributes | |
PlayerGameData | gameData |
the player game data | |
Profile | profile |
the player profile | |
vector< PowerupId > | powerups |
powerups that are enabled for this player | |
TetrisPiece | currPiece |
the currently falling tetris piece | |
TetrisPiece | nextPiece |
the next tetris piece | |
float | cubeAngle |
s16 | playfieldDX |
s16 | playfieldDY |
u8 | powerupsSize |
the actual size of the powerups array | |
u8 | playfieldWidth |
u8 | playfieldHeight |
u8 | playfieldScale |
u8 | id |
u8 | rotation |
u8 | guide |
bool | isShakeEnabled |
bool | isPreviewEnabled |
bool | isHandicapEnabled |
This class represents a player.
Definition at line 59 of file Player.h.
void Player::DrawPiece | ( | TetrisPiece * | cp = NULL , |
|
u8 | alpha = 255 | |||
) |
Draws a tetris piece.
If no piece is specified, then the player's current piece is drawn.
Definition at line 102 of file Player.cpp.
int Player::GetEffectQueueSlot | ( | ) | [inline] |
int Player::GetPowerupQueueSlot | ( | ) | [inline] |
bool Player::MovePiece | ( | int | type, | |
TetrisPiece * | cp = NULL | |||
) |
Moves the tetris piece in the given direction.
If no piece is specified then the player's current piece is used.
Definition at line 282 of file Player.cpp.
bool Player::QueueEffect | ( | Powerup * | powerup | ) | [inline] |
bool Player::RemoveEffect | ( | Powerup * | powerup | ) | [inline] |