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

Server side Map. Enabled to send packets to all player inside it. More...

#include <Map.hpp>

Inheritance diagram for yse::Map:
Collaboration diagram for yse::Map:

List of all members.

Public Member Functions

 Map (const yap::ID &id)
virtual ~Map ()
void AddObject (yap::DynamicWorldObject *object)
void RemoveObject (yap::DynamicWorldObject *object)
void RemoveObject (const yap::ID &objectWorldID)
void AddObject (yap::StaticWorldObject *object)
void RemoveObject (yap::StaticWorldObject *object)
void AddPlayer (Player *player)
 Adds Player player to this Map.
void RemovePlayer (Player *player)
 Removes Player player from this Map.
void SendLoadObjects (yap::IPacket &packet)
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::IPacketHandler
virtual ~IPacketHandler ()

Protected Member Functions

virtual void HandleAddDynamicObject (yap::DynamicWorldObject *object)
virtual void HandleRemoveDynamicObject (yap::DynamicWorldObject *object)
- 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 HandleUpdate (const Time &dt)
virtual void HandleAddObject (WorldObject *object)
virtual void HandleAddStaticObject (StaticWorldObject *object)
virtual void HandleAddUpdateable (IUpdateable *updateable)
virtual void HandleRemoveObject (WorldObject *object)
virtual void HandleRemoveStaticObject (StaticWorldObject *object)
virtual void HandleRemoveUpdateable (IUpdateable *updateable)

Private Member Functions

 DISALLOW_COPY (Map)
void HandleOnObjectVelocityChanged (yap::DynamicWorldObject &sender, const yap::Vector2 &oldVelocity, const yap::Vector2 &currentVelocity)
void HandleOnObjectStateChanged (yap::DynamicWorldObject &sender, const yap::String &oldState, const yap::String &currentState)
void SendObjectMoveInfo (const yap::DynamicWorldObject &object, const yap::Vector2 &velocity)
void SendUpdateObjectState (const yap::DynamicWorldObject &object, const yap::String &state)
void SendAddObject (const yap::DynamicWorldObject &object)
void SendRemoveObject (const yap::DynamicWorldObject &object)

Private Attributes

yap::collection::Map< yap::ID,
Player * > 
players_
yap::PacketHandler packetHandler_

Static Private Attributes

static const yap::String VELOCITY_CHANGED_SYNCHRONIZATION_HANDLER_NAME = "VelocitySync"
static const yap::String STATE_CHANGED_SYNCHRONIZATION_HANDLER_NAME = "StateSync"

Detailed Description

Server side Map. Enabled to send packets to all player inside it.

Definition at line 16 of file Map.hpp.


Constructor & Destructor Documentation

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

Reimplemented from yap::Map.

Definition at line 15 of file Map.cpp.

yse::Map::~Map ( )
virtual

Reimplemented from yap::Map.

Definition at line 22 of file Map.cpp.


Member Function Documentation

void yse::Map::AddObject ( yap::DynamicWorldObject object)

Definition at line 26 of file Map.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yse::Map::AddObject ( yap::StaticWorldObject object)

Definition at line 41 of file Map.cpp.

Here is the call graph for this function:

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

Adds Player player to this Map.

Parameters:
playerPlayer to add to this Map.

Definition at line 51 of file Map.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Implements yap::IPacketHandler.

Definition at line 85 of file Map.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

yse::Map::DISALLOW_COPY ( Map  )
private
void yse::Map::HandleAddDynamicObject ( yap::DynamicWorldObject object)
protectedvirtual

Reimplemented from yap::Map.

Definition at line 100 of file Map.cpp.

Here is the call graph for this function:

void yse::Map::HandleOnObjectStateChanged ( yap::DynamicWorldObject sender,
const yap::String oldState,
const yap::String currentState 
)
private

Definition at line 144 of file Map.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yse::Map::HandleOnObjectVelocityChanged ( yap::DynamicWorldObject sender,
const yap::Vector2 oldVelocity,
const yap::Vector2 currentVelocity 
)
private

Definition at line 136 of file Map.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Implements yap::IPacketHandler.

Definition at line 69 of file Map.cpp.

Here is the call graph for this function:

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

Reimplemented from yap::Map.

Definition at line 123 of file Map.cpp.

Here is the call graph for this function:

void yse::Map::RemoveObject ( yap::DynamicWorldObject object)

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 yse::Map::RemoveObject ( const yap::ID objectWorldID)

Definition at line 36 of file Map.cpp.

Here is the call graph for this function:

void yse::Map::RemoveObject ( yap::StaticWorldObject object)

Definition at line 46 of file Map.cpp.

Here is the call graph for this function:

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

Removes Player player from this Map.

Parameters:
playerPlayer to remove from this Map.

Definition at line 60 of file Map.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Implements yap::IPacketHandler.

Definition at line 90 of file Map.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yse::Map::SendAddObject ( const yap::DynamicWorldObject object)
private

Definition at line 179 of file Map.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yse::Map::SendLoadObjects ( yap::IPacket packet)

Definition at line 200 of file Map.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yse::Map::SendObjectMoveInfo ( const yap::DynamicWorldObject object,
const yap::Vector2 velocity 
)
private

Definition at line 152 of file Map.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Implements yap::IPacketHandler.

Definition at line 74 of file Map.cpp.

Here is the caller graph for this function:

void yse::Map::SendRemoveObject ( const yap::DynamicWorldObject object)
private

Definition at line 190 of file Map.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yse::Map::SendUpdateObjectState ( const yap::DynamicWorldObject object,
const yap::String state 
)
private

Definition at line 165 of file Map.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Implements yap::IPacketHandler.

Definition at line 95 of file Map.cpp.

Here is the call graph for this function:


Member Data Documentation

yap::PacketHandler yse::Map::packetHandler_
private

Definition at line 83 of file Map.hpp.

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

Definition at line 81 of file Map.hpp.

const yap::String yse::Map::STATE_CHANGED_SYNCHRONIZATION_HANDLER_NAME = "StateSync"
staticprivate

Definition at line 79 of file Map.hpp.

const yap::String yse::Map::VELOCITY_CHANGED_SYNCHRONIZATION_HANDLER_NAME = "VelocitySync"
staticprivate

Definition at line 78 of file Map.hpp.


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