geekbrains_gof/SBomber/include/GameObject.h

27 lines
524 B
C
Raw Permalink Normal View History

2021-12-20 22:22:05 +00:00
#pragma once
#include <cstdint>
class GameObject {
public:
GameObject() : x(0.0), y(0.0), width(0) {}
virtual ~GameObject() = default;
virtual void Draw() const = 0;
inline void SetPos(double nx, double ny) {
x = nx;
y = ny;
}
inline double GetY() const { return y; }
inline double GetX() const { return x; }
inline void SetWidth(uint16_t widthN) { width = widthN; }
inline uint16_t GetWidth() const { return width; }
protected:
double x, y;
uint16_t width;
};