Documentation for C++/SDL 2.0 Tile Engine
Making a simple tile based engine
 All Classes Namespaces Functions Variables Enumerations
Public Member Functions | Protected Attributes | List of all members
GameObjectManager Class Reference

Handles the GameObjects in the active state. More...

#include <gameobjectmanager.h>

Inherited by GameObjectEditor, and UiObjectManager.

Public Member Functions

virtual void Draw ()
 Draw the game objects.
virtual void Update ()
 Update the objects.
virtual void Move (float deltaT)
void SetCollisionMaps (Map *map)
void Register (std::shared_ptr< GameObject > obj)
void Register (std::shared_ptr< Camera > camera)
virtual void CheckMouseEvents ()
virtual void HandleMouseEvent (const SDL_MouseButtonEvent &mouseEvent)
virtual void HandleMouseEvent (const SDL_MouseMotionEvent &mouseEvent)
Json::Value Save ()

Protected Attributes

GameObjectList mGameObjects
 The list of objects in the scene.
std::shared_ptr< CameramCamera

Detailed Description

Handles the GameObjects in the active state.

A class to simplify handling of the objects, and simple collision interactions between them

Member Function Documentation

void GameObjectManager::CheckMouseEvents ( )
virtual

Testing the new method for mouse handling

void GameObjectManager::HandleMouseEvent ( const SDL_MouseButtonEvent &  mouseEvent)
virtual

Handle mouse clicks, run through the active game objects find what was clicked, and call it

Parameters
mouseEventThe mouse event that we're processing

Reimplemented in GameObjectEditor, and UiObjectManager.

void GameObjectManager::HandleMouseEvent ( const SDL_MouseMotionEvent &  mouseEvent)
virtual

Handle Mouse motion, check if the mouse entered/exited an object

Parameters
mouseEventThe mouse event that we're processing

Reimplemented in UiObjectManager.

void GameObjectManager::Move ( float  deltaT)
virtual

Move the game objects

Parameters
deltaTThe time elapsed

Reimplemented in UiObjectManager.

void GameObjectManager::Register ( std::shared_ptr< GameObject obj)

Register a GameObject to be managed by the manager

Parameters
objThe object to register
void GameObjectManager::Register ( std::shared_ptr< Camera camera)

Register the scene camera with the manager so that it can be used in checking which objects to deal with

Parameters
cameraThe scene camera
Json::Value GameObjectManager::Save ( )

Serialize all the game object data to a Json::Value and return it

Returns
Json::Value containing the gameobject data
void GameObjectManager::SetCollisionMaps ( Map map)

Setup object collision maps

Parameters
mapThe map to get the collision maps from

The documentation for this class was generated from the following files: