1#ifndef _BOMBERMAN_ENTITIES_OBJECT_H_
2#define _BOMBERMAN_ENTITIES_OBJECT_H_
21 Object(SDL_Renderer* renderer);
33 void setSize(
const int width,
const int height);
56 void setClip(
const int width,
const int height,
const int x,
const int y);
113 const SDL_Rect&
getRect()
const;
125 void setFlip(SDL_RendererFlip flip);
135 virtual void update(
const unsigned int delta);
141 void draw(
const SDL_Rect& camera)
const;
144 SDL_Renderer* renderer =
nullptr;
145 std::shared_ptr<SDL_Texture> texture =
nullptr;
148 SDL_RendererFlip flipping = SDL_FLIP_NONE;
149 float positionX = 0.0f;
150 float positionY = 0.0f;
151 Uint8 colorModR = 0xFF;
152 Uint8 colorModG = 0xFF;
153 Uint8 colorModB = 0xFF;
156 bool isAttachedToCamera =
true;
Base class for objects.
Definition Object.h:14
int getPositionX() const
Get the Position X of object (integer)
Definition Object.cpp:69
bool isVisible() const
Returns whether this object is currently drawable.
Definition Object.cpp:54
virtual void update(const unsigned int delta)
Update object.
Definition Object.cpp:116
void attachToCamera(bool isAttached=true)
Attach object to camera movement.
Definition Object.cpp:44
SDL_FRect getRectF() const
Get Rect of object (float position)
Definition Object.cpp:94
void setPosition(const int x, const int y)
Set the Position of object (integer)
Definition Object.cpp:23
float getPositionYF() const
Get the Position Y of object (float)
Definition Object.cpp:84
void setVisible(bool isVisible)
Toggle whether this object should currently be drawn.
Definition Object.cpp:49
virtual ~Object()
Destroy the object.
Definition Object.cpp:15
float getPositionXF() const
Get the Position X of object (float)
Definition Object.cpp:79
void setColorMod(Uint8 r, Uint8 g, Uint8 b)
Set texture color modulation applied during draw.
Definition Object.cpp:109
const SDL_Rect & getRect() const
Get Rect of object.
Definition Object.cpp:89
void setSize(const int width, const int height)
Set the Size of object.
Definition Object.cpp:17
int getPositionY() const
Get the Position Y of object (integer)
Definition Object.cpp:74
int getWidth() const
Get the Width of object.
Definition Object.cpp:59
int getHeight() const
Get the Height of object.
Definition Object.cpp:64
void setFlip(SDL_RendererFlip flip)
Set the Flip object.
Definition Object.cpp:104
void setClip(const int width, const int height, const int x, const int y)
Set the Clip of source texture.
Definition Object.cpp:36
void draw(const SDL_Rect &camera) const
Draw object on the screen.
Definition Object.cpp:118
void setPositionF(const float x, const float y)
Set the Position of object (float/sub-pixel)
Definition Object.cpp:28