CCIMXDesktop
 
Loading...
Searching...
No Matches
Obsticals Class Referenceabstract

Base class for all obstacle objects in the game. More...

#include <Obsticals.h>

Inheritance diagram for Obsticals:
FigureObject BirdObsticals CactusObsticals

Public Slots

virtual void set_moving_speed (const int speed)
 Sets moving speed.
 

Signals

void pass_me_already ()
 Emitted when obstacle passes out of view.
 
void speedChanged (int newSpeed)
 Emitted when speed changes.
 

Public Member Functions

 Obsticals (QObject *parent=nullptr)
 Constructs an Obsticals object.
 
virtual ~Obsticals ()=default
 Default virtual destructor.
 
virtual bool is_intersect (Dinasour *dinasour)
 Checks collision with dinosaur.
 
int get_moving_speed () const
 Gets current moving speed.
 
virtual void update_position ()
 Updates obstacle position.
 
virtual QRect & provide_current_bounding_rect ()=0
 Provides collision bounding rectangle (pure virtual)
 
virtual QPixmap & provide_drawing_srcframe ()=0
 Provides drawing frame (pure virtual)
 
- Public Member Functions inherited from FigureObject
 FigureObject (QObject *parent=nullptr)
 Constructs a FigureObject.
 
virtual ~FigureObject ()=default
 Virtual destructor.
 

Protected Attributes

std::shared_ptr< QMutex > mutex
 Mutex for thread safety.
 

Properties

int moving_speed { Settings::Scene::Difficulty::DEF_SPEED }
 Current movement speed.
 

Detailed Description

Base class for all obstacle objects in the game.

Constructor & Destructor Documentation

◆ Obsticals()

Obsticals::Obsticals ( QObject *  parent = nullptr)
explicit

Constructs an Obsticals object.

Parameters
parentParent QObject

Member Function Documentation

◆ get_moving_speed()

int Obsticals::get_moving_speed ( ) const
inline

Gets current moving speed.

Returns
Current speed value

◆ is_intersect()

bool Obsticals::is_intersect ( Dinasour dinasour)
virtual

Checks collision with dinosaur.

Parameters
dinasourPointer to dinosaur object
Returns
True if collision detected

◆ provide_current_bounding_rect()

virtual QRect & Obsticals::provide_current_bounding_rect ( )
pure virtual

Provides collision bounding rectangle (pure virtual)

Returns
Reference to current QRect

Implements FigureObject.

Implemented in BirdObsticals, and CactusObsticals.

◆ provide_drawing_srcframe()

virtual QPixmap & Obsticals::provide_drawing_srcframe ( )
pure virtual

Provides drawing frame (pure virtual)

Returns
Reference to current QPixmap

Implements FigureObject.

Implemented in BirdObsticals, and CactusObsticals.

◆ set_moving_speed

void Obsticals::set_moving_speed ( const int  speed)
virtualslot

Sets moving speed.

Parameters
speedNew speed value

◆ speedChanged

void Obsticals::speedChanged ( int  newSpeed)
signal

Emitted when speed changes.

Parameters
newSpeedNew speed value

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