diff options
Diffstat (limited to 'src/systems/pondering.h')
| -rw-r--r-- | src/systems/pondering.h | 34 | 
1 files changed, 16 insertions, 18 deletions
| diff --git a/src/systems/pondering.h b/src/systems/pondering.h index abc6db2..273db67 100644 --- a/src/systems/pondering.h +++ b/src/systems/pondering.h | |||
| @@ -4,19 +4,7 @@ | |||
| 4 | #include "system.h" | 4 | #include "system.h" | 
| 5 | #include "components/ponderable.h" | 5 | #include "components/ponderable.h" | 
| 6 | #include "direction.h" | 6 | #include "direction.h" | 
| 7 | 7 | #include "vector.h" | |
| 8 | struct CollisionResult | ||
| 9 | { | ||
| 10 | double newX; | ||
| 11 | double newY; | ||
| 12 | bool stopProcessing = false; | ||
| 13 | bool touchedWall = false; | ||
| 14 | bool adjacentlyWarping = false; | ||
| 15 | Direction adjWarpDir; | ||
| 16 | size_t adjWarpMapId; | ||
| 17 | bool grounded = false; | ||
| 18 | EntityManager::id_type groundEntity; | ||
| 19 | }; | ||
| 20 | 8 | ||
| 21 | class PonderingSystem : public System { | 9 | class PonderingSystem : public System { | 
| 22 | public: | 10 | public: | 
| @@ -47,7 +35,19 @@ public: | |||
| 47 | 35 | ||
| 48 | private: | 36 | private: | 
| 49 | 37 | ||
| 50 | 38 | struct CollisionResult | |
| 39 | { | ||
| 40 | vec2d pos; | ||
| 41 | bool stopProcessing = false; | ||
| 42 | bool touchedWall = false; | ||
| 43 | bool blockedHoriz = false; | ||
| 44 | bool blockedVert = false; | ||
| 45 | bool adjacentlyWarping = false; | ||
| 46 | Direction adjWarpDir; | ||
| 47 | size_t adjWarpMapId; | ||
| 48 | bool grounded = false; | ||
| 49 | id_type groundEntity; | ||
| 50 | }; | ||
| 51 | 51 | ||
| 52 | void tickBody( | 52 | void tickBody( | 
| 53 | id_type entity, | 53 | id_type entity, | 
| @@ -56,13 +56,11 @@ private: | |||
| 56 | 56 | ||
| 57 | CollisionResult moveBody( | 57 | CollisionResult moveBody( | 
| 58 | id_type entity, | 58 | id_type entity, | 
| 59 | double x, | 59 | vec2d newPos); | 
| 60 | double y); | ||
| 61 | 60 | ||
| 62 | CollisionResult detectCollisions( | 61 | CollisionResult detectCollisions( | 
| 63 | id_type entity, | 62 | id_type entity, | 
| 64 | double x, | 63 | vec2d newPos); | 
| 65 | double y); | ||
| 66 | 64 | ||
| 67 | template <typename Param> | 65 | template <typename Param> | 
| 68 | void detectCollisionsInDirection( | 66 | void detectCollisionsInDirection( | 
