casse-brick
Loading...
Searching...
No Matches
Public Member Functions | Data Fields | Private Attributes
WALL Class Reference

#include <WALL.h>

Inheritance diagram for WALL:
CollidingObject

Public Member Functions

 WALL (int x, int y, int width, int height, const std::string &id, bool kill)
 
void render (std::shared_ptr< SDL_Renderer > renderer, SDL_Color color1, SDL_Color color2) override
 Renders the object on the screen.
 
void handleCollisions (point collision) override
 Handles collisions with other objects.
 
- Public Member Functions inherited from CollidingObject
 CollidingObject (int x, int y, int radius, const std::string &id)
 Constructs a new CollidingObject with a circular collider.
 
 CollidingObject (int x, int y, int width, int height, const std::string &id)
 Constructs a new CollidingObject with a rectangular collider.
 
 CollidingObject (int x, int y, int width, int height, bool isTop, const std::string &id)
 Constructs a new CollidingObject with a triangular collider.
 
 CollidingObject (int x, int y, int width, int height, int edges, const std::string &id)
 Constructs a new CollidingObject with a hexagonal collider.
 
std::shared_ptr< CollidergetCollider ()
 Gets the collider associated with the object.
 
virtual void handleCollisions (point collision)=0
 Handles collisions with other objects.
 
virtual void render (std::shared_ptr< SDL_Renderer > renderer, SDL_Color color1, SDL_Color color2)=0
 Renders the object on the screen.
 

Data Fields

bool kills
 

Private Attributes

SDL_Color color
 
SDL_Rect rect {}
 

Additional Inherited Members

- Protected Attributes inherited from CollidingObject
std::shared_ptr< Collidercollider
 The collider associated with the object.
 

Detailed Description

Definition at line 18 of file WALL.h.

Constructor & Destructor Documentation

◆ WALL()

WALL::WALL ( int  x,
int  y,
int  width,
int  height,
const std::string &  id,
bool  kill 
)

Definition at line 7 of file WALL.cpp.

Member Function Documentation

◆ handleCollisions()

void WALL::handleCollisions ( point  collision)
inlineoverridevirtual

Handles collisions with other objects.

Parameters
collisionThe point of collision.

Implements CollidingObject.

Definition at line 26 of file WALL.h.

◆ render()

void WALL::render ( std::shared_ptr< SDL_Renderer >  renderer,
SDL_Color  color1,
SDL_Color  color2 
)
overridevirtual

Renders the object on the screen.

Parameters
rendererA shared pointer to the SDL renderer used for rendering.
color1The primary color of the object.
color2The secondary color of the object.

Implements CollidingObject.

Definition at line 16 of file WALL.cpp.

Field Documentation

◆ color

SDL_Color WALL::color
private

Definition at line 20 of file WALL.h.

◆ kills

bool WALL::kills

Definition at line 23 of file WALL.h.

◆ rect

SDL_Rect WALL::rect {}
private

Definition at line 21 of file WALL.h.


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