YAPOG  0.0.1
Yet Another Pokemon Online Game
yap::Map Class Reference

Base Map class for both client and server. More...

#include <Map.hpp>

Inheritance diagram for yap::Map:
Collaboration diagram for yap::Map:

List of all members.

Public Member Functions

virtual ~Map ()
const IDGetID () const
void SetID (const ID &id)
const StringGetName () const
void SetName (const String &name)
const IDGetWorldID () const
void SetWorldID (const ID &worldID)
const uintGetWidth () const
const uintGetHeight () const
void SetSize (uint width, uint height)
const Vector2GetSize () const
void SetCollidableArea (CollidableArea *collidableArea)
IUpdateable members.
virtual void Update (const Time &dt)
 Makes the object evolve for one frame of the game.
ICloneable members.
virtual MapClone () const
- Public Member Functions inherited from yap::IUpdateable
virtual ~IUpdateable ()
- Public Member Functions inherited from yap::IIDLoadable
virtual ~IIDLoadable ()
- Public Member Functions inherited from yap::ICloneable
virtual ~ICloneable ()

Protected Member Functions

 Map (const ID &id)
DynamicWorldObjectGetObject (const ID &worldID)
const
DynamicWorldObjectCollection
GetDynamicObjects () const
void AddObject (WorldObject *object)
void AddUpdateable (IUpdateable *updateable)
void AddStaticObject (StaticWorldObject *object)
void AddDynamicObject (DynamicWorldObject *object)
void RemoveObject (WorldObject *object)
void RemoveUpdateable (IUpdateable *updateable)
void RemoveStaticObject (StaticWorldObject *object)
void RemoveDynamicObject (DynamicWorldObject *object)
virtual void HandleSetSize (uint width, uint height)
virtual void HandleUpdate (const Time &dt)
virtual void HandleAddObject (WorldObject *object)
virtual void HandleAddStaticObject (StaticWorldObject *object)
virtual void HandleAddDynamicObject (DynamicWorldObject *object)
virtual void HandleAddUpdateable (IUpdateable *updateable)
virtual void HandleRemoveObject (WorldObject *object)
virtual void HandleRemoveStaticObject (StaticWorldObject *object)
virtual void HandleRemoveDynamicObject (DynamicWorldObject *object)
virtual void HandleRemoveUpdateable (IUpdateable *updateable)

Private Member Functions

 DISALLOW_COPY (Map)
virtual bool SupportsEvents () const
void UpdateEvents (const Time &dt)
void UpdateObjectEvents (DynamicWorldObject &object)
void RemoveObjectEvents (DynamicWorldObject &object)
void UpdateSize ()

Private Attributes

ID id_
String name_
ID worldID_
uint width_
uint height_
Vector2 size_
collection::List< WorldObject * > objects_
DynamicWorldObjectCollection dynamicObjects_
collection::List< IUpdateable * > updateables_
CollidableAreacollidableArea_
MapEventManager eventManager_

Static Private Attributes

static const String DEFAULT_NAME = "<ANONYMOUS_MAP>"
static const uint DEFAULT_WIDTH = 0
static const uint DEFAULT_HEIGHT = 0
static const float DEFAULT_CELL_SIZE = 32.0f
static const String MOVED_UPDATE_EVENT_HANDLER_NAME = "MoveUpdateEvent"

Detailed Description

Base Map class for both client and server.

Definition at line 23 of file Map.hpp.


Constructor & Destructor Documentation

yap::Map::~Map ( )
virtual

Reimplemented in ycl::Map, and yse::Map.

Definition at line 40 of file Map.cpp.

yap::Map::Map ( const ID id)
protected

Reimplemented in ycl::Map, and yse::Map.

Definition at line 18 of file Map.cpp.

Here is the call graph for this function:


Member Function Documentation

void yap::Map::AddDynamicObject ( DynamicWorldObject object)
protected

Definition at line 168 of file Map.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yap::Map::AddObject ( WorldObject object)
protected

Definition at line 153 of file Map.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yap::Map::AddStaticObject ( StaticWorldObject object)
protected

Definition at line 160 of file Map.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yap::Map::AddUpdateable ( IUpdateable updateable)
protected

Definition at line 177 of file Map.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Map * yap::Map::Clone ( ) const
virtual

Implements yap::ICloneable.

Definition at line 46 of file Map.cpp.

yap::Map::DISALLOW_COPY ( Map  )
private
const DynamicWorldObjectCollection & yap::Map::GetDynamicObjects ( ) const
protected

Definition at line 148 of file Map.cpp.

Here is the caller graph for this function:

const uint & yap::Map::GetHeight ( ) const

Definition at line 86 of file Map.cpp.

const ID & yap::Map::GetID ( ) const

Definition at line 51 of file Map.cpp.

Here is the caller graph for this function:

const String & yap::Map::GetName ( ) const

Definition at line 61 of file Map.cpp.

DynamicWorldObject & yap::Map::GetObject ( const ID worldID)
protected

Definition at line 143 of file Map.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

const Vector2 & yap::Map::GetSize ( ) const

Definition at line 99 of file Map.cpp.

Here is the caller graph for this function:

const uint & yap::Map::GetWidth ( ) const

Definition at line 81 of file Map.cpp.

const ID & yap::Map::GetWorldID ( ) const

Definition at line 71 of file Map.cpp.

Here is the caller graph for this function:

void yap::Map::HandleAddDynamicObject ( DynamicWorldObject object)
protectedvirtual

Reimplemented in yse::Map.

Definition at line 224 of file Map.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yap::Map::HandleAddObject ( WorldObject object)
protectedvirtual

Definition at line 215 of file Map.cpp.

Here is the caller graph for this function:

void yap::Map::HandleAddStaticObject ( StaticWorldObject object)
protectedvirtual

Definition at line 220 of file Map.cpp.

Here is the caller graph for this function:

void yap::Map::HandleAddUpdateable ( IUpdateable updateable)
protectedvirtual

Definition at line 237 of file Map.cpp.

Here is the caller graph for this function:

void yap::Map::HandleRemoveDynamicObject ( DynamicWorldObject object)
protectedvirtual

Reimplemented in yse::Map.

Definition at line 250 of file Map.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yap::Map::HandleRemoveObject ( WorldObject object)
protectedvirtual

Definition at line 241 of file Map.cpp.

Here is the caller graph for this function:

void yap::Map::HandleRemoveStaticObject ( StaticWorldObject object)
protectedvirtual

Definition at line 246 of file Map.cpp.

Here is the caller graph for this function:

void yap::Map::HandleRemoveUpdateable ( IUpdateable updateable)
protectedvirtual

Definition at line 257 of file Map.cpp.

Here is the caller graph for this function:

void yap::Map::HandleSetSize ( uint  width,
uint  height 
)
protectedvirtual

Definition at line 112 of file Map.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yap::Map::HandleUpdate ( const Time dt)
protectedvirtual

Reimplemented in ycl::Map.

Definition at line 138 of file Map.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yap::Map::RemoveDynamicObject ( DynamicWorldObject object)
protected

Definition at line 199 of file Map.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yap::Map::RemoveObject ( WorldObject object)
protected

Definition at line 184 of file Map.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yap::Map::RemoveObjectEvents ( DynamicWorldObject object)
private

Definition at line 282 of file Map.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yap::Map::RemoveStaticObject ( StaticWorldObject object)
protected

Definition at line 191 of file Map.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yap::Map::RemoveUpdateable ( IUpdateable updateable)
protected

Definition at line 208 of file Map.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yap::Map::SetCollidableArea ( CollidableArea collidableArea)

Definition at line 104 of file Map.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yap::Map::SetID ( const ID id)

Definition at line 56 of file Map.cpp.

Here is the caller graph for this function:

void yap::Map::SetName ( const String name)

Definition at line 66 of file Map.cpp.

Here is the caller graph for this function:

void yap::Map::SetSize ( uint  width,
uint  height 
)

Definition at line 91 of file Map.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yap::Map::SetWorldID ( const ID worldID)

Definition at line 76 of file Map.cpp.

Here is the caller graph for this function:

bool yap::Map::SupportsEvents ( ) const
privatevirtual

Reimplemented in ycl::Map.

Definition at line 261 of file Map.cpp.

Here is the caller graph for this function:

void yap::Map::Update ( const Time dt)
virtual

Makes the object evolve for one frame of the game.

Parameters:
dtDelta time since the last frame.
Todo:
Move decomposition: dedicated classes.

Implements yap::IUpdateable.

Definition at line 119 of file Map.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yap::Map::UpdateEvents ( const Time dt)
private

Definition at line 266 of file Map.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yap::Map::UpdateObjectEvents ( DynamicWorldObject object)
private

Definition at line 274 of file Map.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yap::Map::UpdateSize ( )
private

Definition at line 290 of file Map.cpp.

Here is the caller graph for this function:


Member Data Documentation

CollidableArea* yap::Map::collidableArea_
private

Definition at line 120 of file Map.hpp.

const float yap::Map::DEFAULT_CELL_SIZE = 32.0f
staticprivate

Definition at line 102 of file Map.hpp.

const uint yap::Map::DEFAULT_HEIGHT = 0
staticprivate

Definition at line 101 of file Map.hpp.

const String yap::Map::DEFAULT_NAME = "<ANONYMOUS_MAP>"
staticprivate

Definition at line 99 of file Map.hpp.

const uint yap::Map::DEFAULT_WIDTH = 0
staticprivate

Definition at line 100 of file Map.hpp.

DynamicWorldObjectCollection yap::Map::dynamicObjects_
private

Definition at line 116 of file Map.hpp.

MapEventManager yap::Map::eventManager_
private

Definition at line 122 of file Map.hpp.

uint yap::Map::height_
private

Definition at line 112 of file Map.hpp.

ID yap::Map::id_
private

Definition at line 106 of file Map.hpp.

const yap::String yap::Map::MOVED_UPDATE_EVENT_HANDLER_NAME = "MoveUpdateEvent"
staticprivate

Definition at line 104 of file Map.hpp.

String yap::Map::name_
private

Definition at line 107 of file Map.hpp.

collection::List<WorldObject*> yap::Map::objects_
private

Definition at line 115 of file Map.hpp.

Vector2 yap::Map::size_
private

Definition at line 113 of file Map.hpp.

collection::List<IUpdateable*> yap::Map::updateables_
private

Definition at line 118 of file Map.hpp.

uint yap::Map::width_
private

Definition at line 111 of file Map.hpp.

ID yap::Map::worldID_
private

Definition at line 109 of file Map.hpp.


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