#ifndef GAME_H #define GAME_H #include #include #include "input/Keys.h" #include "rendering/Renderer.h" class Game final { public: Game(Keys& control); void tick(); void render(float lag, Renderer& renderer) const; bool isRunning() const; private: struct Point { bool operator<(const Point& other); float x; float y; }; bool isLowerTangent(const Point& a, const Point& b, const std::vector& hull) const; bool isUpperTangent(const Point& a, const Point& b, const std::vector& hull) const; void findLowerTangent(const std::vector& hullA, const std::vector& hullB, int& a, int& b) const; void findUpperTangent(const std::vector& hullA, const std::vector& hullB, int& a, int& b) const; int findMaxX(const std::vector& hull) const; int findMinX(const std::vector& hull) const; void split(); float det(const Point& a, const Point& b, const Point& c) const; void merge(); Keys& keys; int keyNext; std::vector data; std::vector convexHull; int active; std::deque> groups[2]; }; #endif