#ifndef BEHAVIOUR_SYSTEM_H_FC908ABE #define BEHAVIOUR_SYSTEM_H_FC908ABE #include "system.h" #include "timer.h" #include "vector.h" enum class PathfindingOptions { None = 0, CardinalDirectionsOnly = 1 << 0, Moonwalking = 1 << 1 }; class Game; class BehaviourSystem : public System { public: static constexpr SystemKey Key = SystemKey::Behaviour; explicit BehaviourSystem(Game& game) : game_(game) {} void tick(double dt) override; void directSpriteToLocation(int spriteId, vec2i pos, PathfindingOptions options = PathfindingOptions::None); bool isFollowingPath(int spriteId); private: void createPath(int spriteId); Game& game_; Timer timer_ { 500 }; Timer overcorrectionTimer_ { 1000/60 }; }; #endif /* end of include guard: BEHAVIOUR_SYSTEM_H_FC908ABE */