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

CactusObsticals inherits from Obsticals and provides size and rendering control. More...

#include <CactusObsticals.h>

Inheritance diagram for CactusObsticals:
Obsticals FigureObject

Public Types

enum class  Size { SMALL , MEDIUM , LARGE }
 Enumeration for cactus size types. More...
 

Public Member Functions

 CactusObsticals (QObject *parent=nullptr)
 Constructor for CactusObsticals.
 
 ~CactusObsticals ()=default
 Default destructor.
 
void setSize (Size s)
 Sets the cactus size.
 
Size getSize () const
 Returns the current size of the cactus.
 
void setAutoUpdateSzRandomly (bool st)
 Enables or disables automatic random size update.
 
bool autoUpdateSzRandomly () const
 Checks if automatic random size update is enabled.
 
QRect & provide_current_bounding_rect () override
 Provides the current bounding rectangle of the cactus.
 
QPixmap & provide_drawing_srcframe () override
 Provides the drawing source frame (QPixmap) for the cactus.
 
- 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 const short SIZE_TYPE_MAX = static_cast<short>(Size::LARGE) + 1
 Constant representing the 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

CactusObsticals inherits from Obsticals and provides size and rendering control.

Represents cactus-type obstacles with variable size and rendering support.

Member Enumeration Documentation

◆ Size

enum class CactusObsticals::Size
strong

Enumeration for cactus size types.

Enumerator
SMALL 

Small size.

MEDIUM 

Medium size.

LARGE 

Large size.

Constructor & Destructor Documentation

◆ CactusObsticals()

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

Constructor for CactusObsticals.

Parameters
parentThe parent QObject, default is nullptr.

Member Function Documentation

◆ autoUpdateSzRandomly()

bool CactusObsticals::autoUpdateSzRandomly ( ) const
inline

Checks if automatic random size update is enabled.

Returns
True if enabled, false otherwise.

◆ getSize()

Size CactusObsticals::getSize ( ) const
inline

Returns the current size of the cactus.

Returns
The current size.

◆ provide_current_bounding_rect()

QRect & CactusObsticals::provide_current_bounding_rect ( )
overridevirtual

Provides the current bounding rectangle of the cactus.

Returns
Reference to the QRect representing the bounding box.

Implements Obsticals.

◆ provide_drawing_srcframe()

QPixmap & CactusObsticals::provide_drawing_srcframe ( )
overridevirtual

Provides the drawing source frame (QPixmap) for the cactus.

Returns
Reference to the QPixmap to be drawn.

Implements Obsticals.

◆ setAutoUpdateSzRandomly()

void CactusObsticals::setAutoUpdateSzRandomly ( bool  st)
inline

Enables or disables automatic random size update.

Parameters
stBoolean flag to enable or disable.

◆ setSize()

void CactusObsticals::setSize ( Size  s)

Sets the cactus size.

Parameters
sThe size to be set.

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