5#ifndef __WORLD_MANAGER_H__
6#define __WORLD_MANAGER_H__
12#include "ObjectList.h"
14#include "SceneGraph.h"
17#define WM df::WorldManager::getInstance()
47 bool isValid(std::string event_type)
const override;
Definition: ObjectList.h:15
Definition: SceneGraph.h:41
Definition: WorldManager.h:21
Box m_view
Player view of game world.
Definition: WorldManager.h:31
Box getView() const
Get player view of game world.
int markForDelete(Object *p_o)
Indicate Object is to be deleted at end of current game loop.
void setBoundary(Box new_boundary)
Set game world boundary.
void operator=(WorldManager const &)
Don't allow assignment.
int insertObject(Object *p_o)
Add Object to world.
void setViewSlack(Vector new_slack)
Set player "slack" for view following.
void setView(Box new_view)
Set player view of game world.
SceneGraph & getSceneGraph() const
Return reference to SceneGraph.
Object * m_p_view_following
Object view is following.
Definition: WorldManager.h:29
SceneGraph m_scene_graph
Storage for all Objects, game and view.
Definition: WorldManager.h:27
ObjectList objectsAtPosition(Vector where) const
Return list of all Objects at position 'where'.
void update()
Update world.
ObjectList getCollisions(Object *p_o, Vector where) const
Return list of Objects collided with at position 'where'.
WorldManager(WorldManager const &)
Don't allow copy.
WorldManager()
Private since a singleton.
ObjectList m_deletions
List of all Objects to delete.
Definition: WorldManager.h:28
void shutDown() override
Shutdown game world (delete all game world Objects).
int removeObject(Object *p_o)
Remove Object from world.
Object * getViewFollowing() const
Get Object view is following (NULL if none).
Object * objectWithId(int id) const
Return Object with indicated id.
int markForDelete(ObjectList obj_list)
Indicate Objects in list are to be deleted at end of current game loop.
ObjectList objectsOnLine(Line line) const
Return a list of all Objects on line from point1 to point2.
void draw()
Draw all Objects in view.
int moveObject(Object *p_o, Vector where)
Move Object.
Box getBoundary() const
Get game world boundary.
bool isValid(std::string event_type) const override
Accept all user-defined events (returns true).
ObjectList objectsInBox(Box box) const
Return list of all Objects in Box.
int setViewFollowing(Object *p_new_view_following)
Set view to center screen on Object.
ObjectList objectsOfType(std::string type)
Return list of Objects matching type.
ObjectList getAllObjects(bool inactive=false) const
Return list of all Objects in world.
int startUp() override
Startup game world (initialize everything to empty).
static WorldManager & getInstance()
Get the one and only instance of the WorldManager.
void setViewPosition(Vector view_pos)
Set view to center screen on position view_pos.
Vector m_view_slack
"Slack" for view following.
Definition: WorldManager.h:32
Vector getViewSlack() const
Get player "slack" for view following.
Box m_boundary
World boundary.
Definition: WorldManager.h:30
ObjectList objectsInCircle(Circle circle) const
Return a list of all Objects in circle.
An animation for a sprite.
Definition: Animation.h:15