Arkanoid Remake  1.0
Public Member Functions | List of all members
Block Class Reference

Wall block. More...

#include <Block.h>

Inheritance diagram for Block:
BoxObj

Public Member Functions

 Block ()
 Constructor: initialize data members.
 
bool Valid () const
 Check if the block was well defined.
 
bool Visible () const
 Check if the block is still visible.
 
void Hide ()
 Hide (destroy only visually) the block.
 
int Hit ()
 Hit the block, return the related score.
 
int State () const
 Get the current block state (decreased when hit, 0=destroyed)
 
const std::string & Bonus () const
 Get the score bonus related to this block.
 
void Set (int typ, int state=0, int score=1, const std::string &bonus="")
 
int Type () const
 Get the type of this block (identifier of the block type)
 
- Public Member Functions inherited from BoxObj
 BoxObj (double x=0.0, double y=0.0)
 Default constructor with optional intialization list.
 
 BoxObj (const BoxObj &obj)
 
VecXyPos ()
 Position.
 
const VecXyPos () const
 Position (read only)
 
VecXyOrigin ()
 Origin (min x,y corner)
 
const VecXyOrigin () const
 Origin (min x,y corner, read-only)
 
VecXySize ()
 Size.
 
const VecXySize () const
 Size (read only)
 
const double MinX () const
 Lower X value.
 
const double MinY () const
 Lower Y value.
 
const double MaxX () const
 Upper X value.
 
const double MaxY () const
 Upper X value.
 
const VecXy HSize () const
 Half size.
 
const double HSizeX () const
 Half size along X axis.
 
const double HSizeY () const
 Half size along Y axis.
 

Additional Inherited Members

- Protected Attributes inherited from BoxObj
VecXy mPos
 
VecXy mSize
 
VecXy mOrigin
 

Detailed Description

Wall block.

The Block class implements the specific behaviour of a specialized box-shaped object, thus it is derived from the BoxObj class.

Member Function Documentation

void Block::Set ( int  typ,
int  state = 0,
int  score = 1,
const std::string &  bonus = "" 
)

Set the attributes of this block

Parameters
typthe type of this block (identifier of the block type)
stateinitial state (decreased when hit, -1 if destroyed)
scorescore when hit
bonusbouns dropped when hit

The documentation for this class was generated from the following file: