#include <Hitbox.hpp>
◆ Hitbox() [1/3]
ECS::Hitbox::Hitbox |
( |
unsigned short |
sizex, |
|
|
unsigned short |
sizey |
|
) |
| |
|
explicitnoexcept |
It sets the width of the hitbox.
- Parameters
-
sizex | The width of the hitbox. |
sizey | The height of the hitbox. |
◆ Hitbox() [2/3]
ECS::Hitbox::Hitbox |
( |
const Hitbox & |
hitbox | ) |
|
|
noexcept |
Copy constructor.
- Parameters
-
hitbox | The hitbox to copy. |
◆ Hitbox() [3/3]
ECS::Hitbox::Hitbox |
( |
Hitbox && |
| ) |
|
|
explicitdeletenoexcept |
◆ ~Hitbox()
◆ getHeight()
unsigned short ECS::Hitbox::getHeight |
( |
| ) |
const |
|
noexcept |
It returns the height of the hitbox.
- Returns
- The height of the hitbox.
◆ getWidth()
unsigned short ECS::Hitbox::getWidth |
( |
| ) |
const |
|
noexcept |
It returns the width of the hitbox.
- Returns
- The width of the hitbox.
◆ isColliding()
If any of the four corners of the current hitbox are inside the other hitbox, then they are colliding
- Parameters
-
current | The position of the current entity |
compare | The hitbox to compare with |
comp | The position of the entity you're comparing to |
- Returns
- A boolean.
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ setHeight()
void ECS::Hitbox::setHeight |
( |
unsigned short |
height | ) |
|
|
noexcept |
Sets the height of the hitbox.
- Parameters
-
height | The height of the hitbox. |
◆ setWidth()
void ECS::Hitbox::setWidth |
( |
unsigned short |
width | ) |
|
|
noexcept |
Sets the width of the hitbox.
- Parameters
-
width | The width of the hitbox. |
The documentation for this class was generated from the following files: