From af7e23ab119eba7c0579796abd288c027edabfa9 Mon Sep 17 00:00:00 2001 From: Paul Oliver Date: Thu, 29 Feb 2024 19:20:22 +0100 Subject: Initial commit --- include/Stage.hpp | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 include/Stage.hpp (limited to 'include/Stage.hpp') diff --git a/include/Stage.hpp b/include/Stage.hpp new file mode 100644 index 0000000..aef99e3 --- /dev/null +++ b/include/Stage.hpp @@ -0,0 +1,44 @@ +#ifndef __STAGE_HPP__ +#define __STAGE_HPP__ + +#include +#include + +#include +#include + +namespace hn = hyperneat; + +class Stage { +public: + int load(const std::string& fileName); + void update(); + void drawOn(sf::RenderWindow& surface) const; + +private: + class CheckPoint { + public: + void calculateSegment(const CheckPoint& prev); + + sf::VertexArray _line = sf::VertexArray(sf::Lines); + double _value = 0.0; + double _segment = 0.0; + b2Body* _body = nullptr; + }; + + b2World _world = { { 0.0f, 0.0f } }; + ContactListener _listener; + + hn::Vector _walls; + hn::Vector _wallBodies; + hn::Vector _traps; + hn::Vector _trapRects; + hn::Vector _checkPoints; + + sf::CircleShape _factory = sf::CircleShape(AGENT_RAD + 2, AGENT_RES); + + friend class App; + friend class Agent; +}; + +#endif // __STAGE_HPP__ -- cgit v1.2.1