-
Notifications
You must be signed in to change notification settings - Fork 0
/
World.h
38 lines (27 loc) · 999 Bytes
/
World.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef WORLD_H
#define WORLD_H
#include "Position.h"
#include <list>
class AbstractObject;
/** @abstract models the scene, contains all known objects and knows about the size.
*/
class World
{
public:
explicit World(float aWidth, float aHeight);
~World();
void addObject(AbstractObject* anAOPtr);
/// Checks whether object pointed to by anAOPtr would be colliding with any other objects
/// if it would be at position aPos with *AABB* size aWidthxaHeight
/// @note the angle in aPos is not used, as you already have to specify the AABB size here
/// @returns true if this object would be colliding.
bool wouldBeColliding(const AbstractObject* anAOPtr, const Position& aPos, float aWidth, float aHeight) const;
float getWidth() const {return theWidth; }
float getHeight() const { return theHeight; }
private:
std::list<AbstractObject*> theAOList;
float theWidth;
float theHeight;
World* theWorldPtr = nullptr;
};
#endif // WORLD_H