C++ Project 2016-2017: Arkanoid
Public Member Functions | List of all members
arkanoid::InvisBlock Class Reference

A "special" Block: when hit with a Ball, make the Ball invisible. More...

#include <invis_block.h>

Inheritance diagram for arkanoid::InvisBlock:
arkanoid::Block arkanoid::Wall arkanoid::Entity arkanoidSFML::InvisBlockSFML

Public Member Functions

 InvisBlock ()
 
 InvisBlock (double x, double y, pair< double, double > size=make_pair(1, 2))
 
 ~InvisBlock ()
 
void update ()
 
void draw () const
 
void effectBall (unique_ptr< Ball > &ball) const
 
- Public Member Functions inherited from arkanoid::Block
 Block ()
 
 Block (double x, double y, pair< double, double > size=make_pair(1, 2))
 
 ~Block ()
 
- Public Member Functions inherited from arkanoid::Wall
 Wall ()
 
 Wall (double x, double y, pair< double, double > size=make_pair(1, 1))
 
 ~Wall ()
 
void update ()
 
void draw () const
 
- Public Member Functions inherited from arkanoid::Entity
 Entity ()
 
 Entity (double x, double y, pair< double, double > newSize=make_pair(1.0, 1.0))
 
virtual ~Entity ()
 
Vector2D getPosition () const
 
void setPosition (double x, double y)
 
void setPosition (const Vector2D &vector)
 
void setSize (pair< double, double > newSize)
 
pair< double, double > getSize () const
 
bool collidesWith (const Entity &other) const
 

Additional Inherited Members

- Protected Attributes inherited from arkanoid::Entity
Vector2D position
 The current position of the Entity (in the 9x7 grid).
 
pair< double, double > size
 The size (width and height respectively) of the Entity.
 

Detailed Description

A "special" Block: when hit with a Ball, make the Ball invisible.

Definition at line 16 of file invis_block.h.

Constructor & Destructor Documentation

◆ InvisBlock() [1/2]

arkanoid::InvisBlock::InvisBlock ( )

Default Constructor.

Initialise the InvisBlock at origin ([0, 0]) in the World.

Definition at line 11 of file invis_block.cpp.

◆ InvisBlock() [2/2]

arkanoid::InvisBlock::InvisBlock ( double  x,
double  y,
pair< double, double >  size = make_pair(1, 2) 
)

Constructor.

Initialise the InvisBlock at a specific position in the World.

Parameters
xThe x position (in the grid) of the InvisBlock.
yThe y position (in the grid) of the InvisBlock.
size(optional) The size (width and height respectively) of the InvisBlock.

Definition at line 13 of file invis_block.cpp.

◆ ~InvisBlock()

arkanoid::InvisBlock::~InvisBlock ( )

Destructor.

Definition at line 15 of file invis_block.cpp.

Member Function Documentation

◆ draw()

void arkanoid::InvisBlock::draw ( ) const
virtual

Do nothing...

Reimplemented from arkanoid::Block.

Definition at line 21 of file invis_block.cpp.

◆ effectBall()

void arkanoid::InvisBlock::effectBall ( unique_ptr< Ball > &  ball) const

Activate this InvisBlock 'speciality': make the Ball invisible for a period of time.

Parameters
ballThe Ball that will be effected.

Definition at line 25 of file invis_block.cpp.

◆ update()

void arkanoid::InvisBlock::update ( )
virtual

Do nothing...

Reimplemented from arkanoid::Block.

Definition at line 17 of file invis_block.cpp.


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