CCIMXDesktop
 
Loading...
Searching...
No Matches
BirdObsticals Class Reference

Represents bird obstacles in the game. More...

#include <BirdObsticals.h>

Inheritance diagram for BirdObsticals:
Obsticals FigureObject

Public Types

enum class  FlyHeight { LOW , MED , HIG }
 Possible flying heights for birds. More...
 
enum class  BirdType { SMALL , MEDIUM , LARGE }
 Possible sizes for birds. More...
 

Public Member Functions

 BirdObsticals (QObject *parent=nullptr)
 Constructs a BirdObsticals object.
 
void setHeight (FlyHeight h)
 Sets flying height.
 
FlyHeight getHeight () const
 Gets current flying height.
 
void setSize (BirdType t)
 Sets bird size.
 
BirdType getSize () const
 Gets current bird size.
 
void setAutoUpdateHeightRandomly (bool st)
 Enables/disables automatic height updates.
 
bool autoheightUpdateSzRandomly () const
 Checks if height auto-update is enabled.
 
void setAutoUpdateSzRandomly (bool st)
 Enables/disables automatic size updates.
 
bool autoUpdateSzRandomly () const
 Checks if size auto-update is enabled.
 
 ~BirdObsticals ()=default
 Default destructor.
 
QRect & provide_current_bounding_rect () override
 Provides current collision bounding rect.
 
QPixmap & provide_drawing_srcframe () override
 Provides current drawing frame.
 
- Public Member Functions inherited from Obsticals
 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.
 
- Public Member Functions inherited from FigureObject
 FigureObject (QObject *parent=nullptr)
 Constructs a FigureObject.
 
virtual ~FigureObject ()=default
 Virtual destructor.
 

Static Public Attributes

static constexpr unsigned short HEIGHT_SIZE_TYPE_MAX = static_cast<unsigned short>(FlyHeight::HIG) + 1
 Maximum number of height types.
 
static constexpr unsigned short SZ_SIZE_TYPE_MAX = static_cast<unsigned short>(BirdType::LARGE) + 1
 Maximum number of size types.
 

Additional Inherited Members

- Public Slots inherited from Obsticals
virtual void set_moving_speed (const int speed)
 Sets moving speed.
 
- Signals inherited from Obsticals
void pass_me_already ()
 Emitted when obstacle passes out of view.
 
void speedChanged (int newSpeed)
 Emitted when speed changes.
 
- Protected Attributes inherited from Obsticals
std::shared_ptr< QMutex > mutex
 Mutex for thread safety.
 
- Properties inherited from Obsticals
int moving_speed { Settings::Scene::Difficulty::DEF_SPEED }
 Current movement speed.
 

Detailed Description

Represents bird obstacles in the game.

Member Enumeration Documentation

◆ BirdType

enum class BirdObsticals::BirdType
strong

Possible sizes for birds.

Enumerator
SMALL 

Small bird size.

MEDIUM 

Medium bird size.

LARGE 

Large bird size.

◆ FlyHeight

enum class BirdObsticals::FlyHeight
strong

Possible flying heights for birds.

Enumerator
LOW 

Low flying height.

MED 

Medium flying height.

HIG 

High flying height.

Constructor & Destructor Documentation

◆ BirdObsticals()

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

Constructs a BirdObsticals object.

Parameters
parentParent QObject

Member Function Documentation

◆ autoheightUpdateSzRandomly()

bool BirdObsticals::autoheightUpdateSzRandomly ( ) const
inline

Checks if height auto-update is enabled.

Returns
True if auto-update is enabled

◆ autoUpdateSzRandomly()

bool BirdObsticals::autoUpdateSzRandomly ( ) const
inline

Checks if size auto-update is enabled.

Returns
True if auto-update is enabled

◆ getHeight()

FlyHeight BirdObsticals::getHeight ( ) const
inline

Gets current flying height.

Returns
Current FlyHeight

◆ getSize()

BirdType BirdObsticals::getSize ( ) const
inline

Gets current bird size.

Returns
Current BirdType

◆ provide_current_bounding_rect()

QRect & BirdObsticals::provide_current_bounding_rect ( )
overridevirtual

Provides current collision bounding rect.

Returns
Reference to current QRect

Implements Obsticals.

◆ provide_drawing_srcframe()

QPixmap & BirdObsticals::provide_drawing_srcframe ( )
overridevirtual

Provides current drawing frame.

Returns
Reference to current QPixmap

Implements Obsticals.

◆ setAutoUpdateHeightRandomly()

void BirdObsticals::setAutoUpdateHeightRandomly ( bool  st)
inline

Enables/disables automatic height updates.

Parameters
stTrue to enable auto-update

◆ setAutoUpdateSzRandomly()

void BirdObsticals::setAutoUpdateSzRandomly ( bool  st)
inline

Enables/disables automatic size updates.

Parameters
stTrue to enable auto-update

◆ setHeight()

void BirdObsticals::setHeight ( FlyHeight  h)

Sets flying height.

Parameters
hDesired flying height

◆ setSize()

void BirdObsticals::setSize ( BirdType  t)

Sets bird size.

Parameters
tDesired bird size

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