Random actions held for random times, like a player mashing the keys.
More...
#include </__w/project-rtype/project-rtype/tools/bot/include/rtype/bot.hpp>
|
| using | Clock = std::chrono::steady_clock |
| | Clock of the holds.
|
| |
|
| | RandomInputs (std::uint32_t seed) |
| | Creates the generator.
|
| |
| aegis2d::ecs::PlayerInput | update (Clock::time_point now) |
| | The input to hold now: a new one once the last has been held long enough.
|
| |
| std::uint64_t | picks () const noexcept |
| | Number of inputs picked.
|
| |
|
| static constexpr std::chrono::milliseconds | shortest_hold {150} |
| | Shortest time an input is held.
|
| |
| static constexpr std::chrono::milliseconds | longest_hold {900} |
| | Longest time an input is held.
|
| |
Random actions held for random times, like a player mashing the keys.
Each pick holds a direction (or none) on each axis, and Fire most of the time, for a time drawn between the shortest and longest hold. The same seed gives the same inputs at the same times.
◆ Clock
◆ RandomInputs()
| rtype::RandomInputs::RandomInputs |
( |
std::uint32_t |
seed | ) |
|
|
explicit |
Creates the generator.
- Parameters
-
◆ picks()
| std::uint64_t rtype::RandomInputs::picks |
( |
| ) |
const |
|
noexcept |
Number of inputs picked.
- Returns
- The count since the generator was created.
◆ update()
| aegis2d::ecs::PlayerInput rtype::RandomInputs::update |
( |
Clock::time_point |
now | ) |
|
The input to hold now: a new one once the last has been held long enough.
- Parameters
-
| now | Current time; the first call picks the first input. |
- Returns
- The held actions.
◆ longest_hold
| constexpr std::chrono::milliseconds rtype::RandomInputs::longest_hold {900} |
|
staticconstexpr |
Longest time an input is held.
◆ shortest_hold
| constexpr std::chrono::milliseconds rtype::RandomInputs::shortest_hold {150} |
|
staticconstexpr |
Shortest time an input is held.
The documentation for this class was generated from the following file:
- /__w/project-rtype/project-rtype/tools/bot/include/rtype/bot.hpp