37 void record(std::uint64_t tick, aegis2d::ecs::Registry& registry);
43 [[nodiscard]] std::optional<aegis2d::Vec2>
position(aegis2d::ecs::Entity entity,
44 std::uint64_t tick)
const;
50 [[nodiscard]] std::vector<std::pair<aegis2d::ecs::Entity, aegis2d::Vec2>>
55 [[nodiscard]] std::optional<std::uint64_t>
oldest() const noexcept;
59 [[nodiscard]] std::optional<std::uint64_t>
newest() const noexcept;
63 [[nodiscard]] std::
size_t size() const noexcept;
70 std::uint64_t tick = 0;
72 std::vector<std::pair<aegis2d::ecs::Entity, aegis2d::Vec2>>
enemies;
75 [[nodiscard]]
const Frame* frame(std::uint64_t tick)
const noexcept;
77 std::deque<Frame> frames_;
The positions of the enemies over the last tuning::position_history_ticks ticks.
Definition position_history.hpp:25
std::optional< aegis2d::Vec2 > position(aegis2d::ecs::Entity entity, std::uint64_t tick) const
Where an enemy was at a past tick.
std::vector< std::pair< aegis2d::ecs::Entity, aegis2d::Vec2 > > enemies(std::uint64_t tick) const
The enemies at a past tick.
void record(std::uint64_t tick, aegis2d::ecs::Registry ®istry)
Keeps the positions of the enemies after a tick.
std::optional< std::uint64_t > newest() const noexcept
Newest tick kept.
std::optional< std::uint64_t > oldest() const noexcept
Oldest tick kept.
static constexpr std::size_t capacity
Ticks kept: 500 ms at 60 ticks per second.
Definition position_history.hpp:28
std::size_t size() const noexcept
Number of ticks kept.
R-Type game code, built on the Aegis2D engine.
Definition enemy_scripts.hpp:16
Gameplay values of R-Type: play area, speeds, sizes, health, lives and scores.