CactusObsticals inherits from Obsticals and provides size and rendering control.
More...
#include <CactusObsticals.h>
|
static constexpr const short | SIZE_TYPE_MAX = static_cast<short>(Size::LARGE) + 1 |
| Constant representing the number of size types.
|
|
|
virtual void | set_moving_speed (const int speed) |
| Sets moving speed.
|
|
void | pass_me_already () |
| Emitted when obstacle passes out of view.
|
|
void | speedChanged (int newSpeed) |
| Emitted when speed changes.
|
|
std::shared_ptr< QMutex > | mutex |
| Mutex for thread safety.
|
|
int | moving_speed { Settings::Scene::Difficulty::DEF_SPEED } |
| Current movement speed.
|
|
CactusObsticals inherits from Obsticals and provides size and rendering control.
Represents cactus-type obstacles with variable size and rendering support.
◆ Size
Enumeration for cactus size types.
Enumerator |
---|
SMALL | Small size.
|
MEDIUM | Medium size.
|
LARGE | Large size.
|
◆ CactusObsticals()
CactusObsticals::CactusObsticals |
( |
QObject * |
parent = nullptr | ) |
|
|
explicit |
Constructor for CactusObsticals.
- Parameters
-
parent | The parent QObject, default is nullptr. |
◆ 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
-
st | Boolean flag to enable or disable. |
◆ setSize()
void CactusObsticals::setSize |
( |
Size |
s | ) |
|
Sets the cactus size.
- Parameters
-
The documentation for this class was generated from the following files:
- extern_app/games/CCIMX_DinoGame/figure/obstacle/CactusObsticals.h
- extern_app/games/CCIMX_DinoGame/figure/obstacle/CactusObsticals.cpp