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

#include <Map.hpp>

Inheritance diagram for ycl::Map:
Collaboration diagram for ycl::Map:

List of all members.

Public Member Functions

 Map (const yap::ID &id)
virtual ~Map ()
void AddTileLayer (yap::uint height, yap::TileLayoutHandler *tileLayoutHandler)
PlayerGetPlayer (const yap::ID &worldID)
bool ContainsPlayer (const yap::ID &worldID) const
void AddPlayer (Player *player)
void RemovePlayer (Player *player)
void RemovePlayer (const yap::ID &worldID)
template<typename T >
void AddDrawableStaticObject (T *object)
template<typename T >
void RemoveDrawableStaticObject (T *object)
template<typename T >
void AddDrawableDynamicObject (T *object)
void RemoveDrawableDynamicObject (const yap::ID &worldID)
void ClearDynamicObjects ()
void SetWorldDrawingPolicy (const yap::IWorldDrawingPolicy &worldDrawingPolicy)
IDrawable members.
virtual void Draw (yap::IDrawingContext &context)
virtual bool IsVisible () const
virtual void Show (bool isVisible)
virtual void ChangeColor (const sf::Color &color)
IPacketHandler members.
virtual bool HandlePacket (yap::IPacket &packet)
virtual bool SendPacket (yap::IPacket &packet)
virtual void AddRelay (yap::IPacketHandler *relay)
virtual void RemoveRelay (yap::IPacketHandler *relay)
virtual void SetParent (yap::IPacketHandler *parent)
- Public Member Functions inherited from yap::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)
virtual void Update (const Time &dt)
 Makes the object evolve for one frame of the game.
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 ()
- Public Member Functions inherited from yap::IDrawable
virtual ~IDrawable ()
- Public Member Functions inherited from yap::IPacketHandler
virtual ~IPacketHandler ()

Public Attributes

yap::Event< Map &, Player & > OnPlayerAdded
yap::Event< Map &, Player & > OnPlayerRemoved

Protected Member Functions

virtual void HandleSetSize (yap::uint width, yap::uint height)
virtual void HandleUpdate (const yap::Time &dt)
- Protected Member Functions inherited from yap::Map
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 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)
void AddDrawableDynamicObject (const yap::ID &worldID, yap::IDrawableDynamicWorldObject *drawableObject)
void AddDrawableObject (yap::IDrawableWorldObject *drawableObject)
void RemoveDrawableObject (yap::IDrawableWorldObject *drawableObject)
virtual bool SupportsEvents () const
void HandleServerInfoObjectMoveInfo (yap::IPacket &packet)
void HandleServerInfoUpdateObjectState (yap::IPacket &packet)

Private Attributes

const yap::IWorldDrawingPolicyworldDrawingPolicy_
yap::TileLayerStack tileLayers_
yap::collection::List
< yap::IDrawableWorldObject * > 
drawableObjects_
yap::collection::Map< yap::ID,
yap::IDrawableDynamicWorldObject * > 
drawableDynamicObjects_
yap::collection::Map< yap::ID,
Player * > 
players_
yap::PacketHandler packetHandler_

Static Private Attributes

static const yap::String DRAW_ORDER_HANDLER_NAME = "DrawOrder"

Detailed Description

Definition at line 25 of file Map.hpp.


Constructor & Destructor Documentation

ycl::Map::Map ( const yap::ID id)
explicit

Reimplemented from yap::Map.

Definition at line 12 of file Map.cpp.

Here is the call graph for this function:

ycl::Map::~Map ( )
virtual

Reimplemented from yap::Map.

Definition at line 27 of file Map.cpp.


Member Function Documentation

template<typename T >
void ycl::Map::AddDrawableDynamicObject ( T *  object)
inline
Todo:
Sort by adding manually.

Definition at line 25 of file Map.hxx.

Here is the call graph for this function:

Here is the caller graph for this function:

void ycl::Map::AddDrawableDynamicObject ( const yap::ID worldID,
yap::IDrawableDynamicWorldObject drawableObject 
)
private

Definition at line 168 of file Map.cpp.

Here is the call graph for this function:

void ycl::Map::AddDrawableObject ( yap::IDrawableWorldObject drawableObject)
private

Definition at line 155 of file Map.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename T >
void ycl::Map::AddDrawableStaticObject ( T *  object)
inline

Definition at line 11 of file Map.hxx.

Here is the call graph for this function:

Here is the caller graph for this function:

void ycl::Map::AddPlayer ( Player player)

Definition at line 48 of file Map.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void ycl::Map::AddRelay ( yap::IPacketHandler relay)
virtual

Implements yap::IPacketHandler.

Definition at line 128 of file Map.cpp.

Here is the call graph for this function:

void ycl::Map::AddTileLayer ( yap::uint  height,
yap::TileLayoutHandler tileLayoutHandler 
)

Definition at line 31 of file Map.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void ycl::Map::ChangeColor ( const sf::Color &  color)
virtual

Implements yap::IDrawable.

Definition at line 114 of file Map.cpp.

void ycl::Map::ClearDynamicObjects ( )

Definition at line 71 of file Map.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool ycl::Map::ContainsPlayer ( const yap::ID worldID) const

Definition at line 43 of file Map.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

ycl::Map::DISALLOW_COPY ( Map  )
private
void ycl::Map::Draw ( yap::IDrawingContext context)
virtual

Implements yap::IDrawable.

Definition at line 94 of file Map.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Player & ycl::Map::GetPlayer ( const yap::ID worldID)

Definition at line 38 of file Map.cpp.

Here is the caller graph for this function:

bool ycl::Map::HandlePacket ( yap::IPacket packet)
virtual

Implements yap::IPacketHandler.

Definition at line 118 of file Map.cpp.

Here is the call graph for this function:

void ycl::Map::HandleServerInfoObjectMoveInfo ( yap::IPacket packet)
private

Definition at line 197 of file Map.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void ycl::Map::HandleServerInfoUpdateObjectState ( yap::IPacket packet)
private

Definition at line 207 of file Map.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 143 of file Map.cpp.

Here is the call graph for this function:

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

Reimplemented from yap::Map.

Definition at line 150 of file Map.cpp.

bool ycl::Map::IsVisible ( ) const
virtual

Implements yap::IDrawable.

Definition at line 105 of file Map.cpp.

Here is the caller graph for this function:

void ycl::Map::RemoveDrawableDynamicObject ( const yap::ID worldID)

Definition at line 177 of file Map.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void ycl::Map::RemoveDrawableObject ( yap::IDrawableWorldObject drawableObject)
private

Definition at line 163 of file Map.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename T >
void ycl::Map::RemoveDrawableStaticObject ( T *  object)
inline

Definition at line 18 of file Map.hxx.

Here is the call graph for this function:

void ycl::Map::RemovePlayer ( Player player)

Definition at line 57 of file Map.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void ycl::Map::RemovePlayer ( const yap::ID worldID)

Definition at line 66 of file Map.cpp.

Here is the call graph for this function:

void ycl::Map::RemoveRelay ( yap::IPacketHandler relay)
virtual

Implements yap::IPacketHandler.

Definition at line 133 of file Map.cpp.

Here is the call graph for this function:

bool ycl::Map::SendPacket ( yap::IPacket packet)
virtual

Implements yap::IPacketHandler.

Definition at line 123 of file Map.cpp.

Here is the call graph for this function:

void ycl::Map::SetParent ( yap::IPacketHandler parent)
virtual

Implements yap::IPacketHandler.

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 ycl::Map::SetWorldDrawingPolicy ( const yap::IWorldDrawingPolicy worldDrawingPolicy)

Definition at line 85 of file Map.cpp.

Here is the caller graph for this function:

void ycl::Map::Show ( bool  isVisible)
virtual

Implements yap::IDrawable.

Definition at line 110 of file Map.cpp.

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

Reimplemented from yap::Map.

Definition at line 192 of file Map.cpp.


Member Data Documentation

const yap::String ycl::Map::DRAW_ORDER_HANDLER_NAME = "DrawOrder"
staticprivate

Definition at line 102 of file Map.hpp.

yap::collection::Map< yap::ID, yap::IDrawableDynamicWorldObject*> ycl::Map::drawableDynamicObjects_
private

Definition at line 111 of file Map.hpp.

yap::collection::List<yap::IDrawableWorldObject*> ycl::Map::drawableObjects_
private

Definition at line 108 of file Map.hpp.

yap::Event<Map&, Player&> ycl::Map::OnPlayerAdded

Definition at line 60 of file Map.hpp.

yap::Event<Map&, Player&> ycl::Map::OnPlayerRemoved

Definition at line 61 of file Map.hpp.

yap::PacketHandler ycl::Map::packetHandler_
private

Definition at line 115 of file Map.hpp.

yap::collection::Map<yap::ID, Player*> ycl::Map::players_
private

Definition at line 113 of file Map.hpp.

yap::TileLayerStack ycl::Map::tileLayers_
private

Definition at line 106 of file Map.hpp.

const yap::IWorldDrawingPolicy* ycl::Map::worldDrawingPolicy_
private

Definition at line 104 of file Map.hpp.


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