Phyzix
Loading...
Searching...
No Matches
StaticObject.h
1//
2// Created by shams on 8/7/24.
3//
4
5#ifndef PHYZIX_STATICOBJECT_H
6#define PHYZIX_STATICOBJECT_H
7
8#include "Drawable.h"
9#include "Boundary.h"
10
11class StaticObject: public Drawable {
12public:
13 float zIndex = 0;
14 Boundaries boundaries;
15
16 RuntimeBaseType getBaseType() const override {
17 return RuntimeBaseType::STATIC_OBJECT;
18 }
19
20 // Constructor takes a callable to implement the draw method
21 StaticObject( void (*drawFunction)())
22 : drawFunction(drawFunction) {}
23
24 // Override the draw method from the base class
25 void draw() const override {
26 drawFunction();
27 }
28
29private:
30 void (*drawFunction)();
31};
32
33
34#endif //PHYZIX_STATICOBJECT_H
Definition Drawable.h:11
Enum class to identify the base type of a class for runtime type identification.
Definition StaticObject.h:11
A struct to hold a list of boundaries.
Definition Boundary.h:21