#include <Speed.hpp>
◆ Speed() [1/3]
ECS::Speed::Speed |
( |
int |
maxSpeed | ) |
|
|
explicitnoexcept |
A constructor for the Speed class.
- Parameters
-
speed | The maximum speed of the entity. |
◆ Speed() [2/3]
ECS::Speed::Speed |
( |
const Speed & |
speed | ) |
|
|
noexcept |
Copy constructor for the Speed component.
- Parameters
-
speed | The speed of the entity. |
◆ Speed() [3/3]
ECS::Speed::Speed |
( |
Speed && |
| ) |
|
|
explicitdeletenoexcept |
◆ ~Speed()
◆ addSpeed()
void ECS::Speed::addSpeed |
( |
int const |
speedToAdd | ) |
|
|
noexcept |
If the speed is greater than the max speed, set the speed to the max speed, otherwise add the speed to the current speed
- Parameters
-
speed | The speed of the entity. |
◆ getMaxSpeed()
int ECS::Speed::getMaxSpeed |
( |
| ) |
const |
|
noexcept |
This function returns the maximum speed of the entity.
- Returns
- The max speed of the entity.
◆ getSpeed()
int ECS::Speed::getSpeed |
( |
| ) |
const |
|
noexcept |
It returns the speed of the entity.
- Returns
- The speed of the entity.
◆ operator=() [1/2]
Speed& ECS::Speed::operator= |
( |
const Speed & |
| ) |
const |
|
deletenoexcept |
◆ operator=() [2/2]
◆ removeSpeed()
void ECS::Speed::removeSpeed |
( |
int const |
speedToRemove | ) |
|
|
noexcept |
If the speed is less than zero, set the speed to zero, otherwise subtract the speed
- Parameters
-
speed | The speed of the entity. |
◆ setMaxSpeed()
void ECS::Speed::setMaxSpeed |
( |
int const |
speedToSet | ) |
|
|
noexcept |
This function returns the maximum speed of the entity.
- Returns
- The max speed of the entity.
◆ setSpeed()
void ECS::Speed::setSpeed |
( |
int const |
speedToSet | ) |
|
|
noexcept |
Sets the speed of the entity.
- Parameters
-
speed | The speed of the entity. |
The documentation for this class was generated from the following files: