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

#include <Player.hpp>

Inheritance diagram for yse::Player:
Collaboration diagram for yse::Player:

List of all members.

Public Member Functions

 Player (const yap::ID &id)
virtual ~Player ()
void SetParentUser (User *parent)
void SetName (const yap::String &name)
ICloneable members.
virtual PlayerClone () const
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)
IPlayer members.
virtual void Accept (yap::IDynamicWorldObjectVisitor &visitor)
virtual void Accept (yap::IDynamicWorldObjectConstVisitor &visitor) const
virtual const yap::StringGetName () const
virtual bool HasInput (yap::GameInputType gameInputType) const
virtual void Warp (const yap::ID &mapWorldID, const yap::Vector2 &point)
virtual void DestroyObject (const yap::ID &objectWorldID)
virtual void TriggerBattle ()
virtual yap::Event
< yap::DynamicWorldObject
&, const yap::Vector2 & > & 
OnMovedEvent ()
- Public Member Functions inherited from yse::Character
virtual ~Character ()
- Public Member Functions inherited from yap::Character
const DirectionGetDirection () const
void RawSetDirection (Direction direction)
- Public Member Functions inherited from yap::DynamicWorldObject
virtual ~DynamicWorldObject ()
const IDGetWorldID () const
void SetWorldID (const ID &id)
const IDGetTypeID () const
 Returns the ID of this type from the ObjectFactory.
const Vector2GetMaxVelocity () const
void SetMaxVelocity (const Vector2 &maxVelocity)
void SetPhysicsCore (PhysicsCore *physicsCore)
void ApplyForce (const Vector2 &force)
const Vector2GetMove () const
void RawSetVelocity (const Vector2 &velocity)
const StringGetState () const
const StringGetLogicalState () const
bool TryChangeState (const String &state)
void SetInactive ()
void RawSetState (const String &state)
 Directly changes this DynamicWorldObject state. Used for synchronizing the attribut.
bool IsActive () const
bool IsMoving () const
void AddTriggerBoundingBox (BoundingBox *boundingBox)
void AddEvent (MapEvent *event)
void RemoveEvent (MapEvent *event)
void GetEventsCollidingWith (const CollidableArea &collidableArea, MapEventQueue &events) const
virtual void Update (const Time &dt)
 Makes the object evolve for one frame of the game.
- Public Member Functions inherited from yap::WorldObject
virtual ~WorldObject ()
const IDGetID () const
void SetID (const ID &id)
void SetCollidableArea (CollidableArea *collidableArea)
void AddPhysicsBoundingBox (BoundingBox *boundingBox)
void RemovePhysicsBoundingBox (BoundingBox *boundingBox)
bool CollidesWith (const CollidableArea &collidableArea, const Vector2 &offset) const
void AdjustCollidablePosition (ICollidable &collidable) const
 Moves the ICollidable collidable to this WorldObject position. To call once when adding the ICollidable to this WorldObject.
virtual const Vector2GetPosition () const
 Gets the coordinates in pixels of the origin of this ISpatial from the global origin.
virtual const Vector2GetSize () const
 Gets the size in pixels of this ISpatial.
virtual const Vector2GetTopLeft () const
virtual const Vector2GetBottomRight () const
virtual const Vector2GetCenter () const
virtual const FloatRectGetRectangle () const
virtual void Move (const Vector2 &offset)
virtual void Scale (const Vector2 &factor)
virtual void SetPosition (const Vector2 &position)
virtual void SetSize (const Vector2 &size)
virtual const int & GetZ () const
 Gets the highness of this ISpatial3.
virtual void SetZ (int z)
 Sets the highness of this ISpatial3.
virtual const int & GetH () const
 Gets the height of this ISpatial3.
virtual void SetH (int h)
 Sets the height of this ISpatial3.
virtual bool CollidesWith (const ICollidable &other) const
virtual bool CollidesWith (const ICollidable &other, const Vector2 &offset) const
- Public Member Functions inherited from yap::ICollidable
virtual ~ICollidable ()
- Public Member Functions inherited from yap::ISpatial3
virtual ~ISpatial3 ()
- Public Member Functions inherited from yap::ISpatial
virtual ~ISpatial ()
- Public Member Functions inherited from yap::IIDLoadable
virtual ~IIDLoadable ()
- Public Member Functions inherited from yap::ICloneable
virtual ~ICloneable ()
- Public Member Functions inherited from yap::IUpdateable
virtual ~IUpdateable ()
- Public Member Functions inherited from yap::IPacketHandler
virtual ~IPacketHandler ()
- Public Member Functions inherited from yap::IPlayer
virtual ~IPlayer ()
virtual bool HasInput (GameInputType gameInputType) const =0

Protected Member Functions

 Player (const Player &copy)
virtual const yap::StringGetObjectFactoryTypeName () const
- Protected Member Functions inherited from yse::Character
 Character (const yap::ID &id)
 Character (const Character &copy)
- Protected Member Functions inherited from yap::Character
 Character (const Character &copy)
void SetDirection (Direction direction)
virtual void HandleSetDirection (Direction direction)
virtual void HandleOnVelocityChanged (const Vector2 &oldVelocity, const Vector2 &currentVelocity)
- Protected Member Functions inherited from yap::DynamicWorldObject
 DynamicWorldObject (const ID &id)
 DynamicWorldObject (const DynamicWorldObject &copy)
virtual void HandleSetWorldID (const ID &worldID)
virtual void HandleSetCollidableArea (CollidableArea *collidableArea)
virtual void HandleApplyForce (const Vector2 &force)
virtual void HandleUpdate (const Time &dt)
virtual void HandleSetState (const String &state)
virtual void HandleMove (const Vector2 &offset)
virtual void HandleScale (const Vector2 &factor)
virtual void HandleSetZ (int z)
virtual void HandleSetH (int h)
- Protected Member Functions inherited from yap::WorldObject
 WorldObject (const ID &id)
 WorldObject (const WorldObject &copy)
const
PhysicsBoundingBoxCollection
GetPhysicsBoundingBoxes () const
virtual Vector2 HandleGetSize () const

Private Member Functions

 DISALLOW_ASSIGN (Player)
void InitHandlers ()
UserGetParent ()
void HandleClientInfoGameInput (yap::IPacket &packet)

Private Attributes

UserparentUser_
yap::String name_
yap::PacketHandler packetHandler_
PlayerInputManager inputManager_

Static Private Attributes

static const yap::String OBJECT_FACTORY_TYPE_NAME = "Player"
static const yap::String DEFAULT_NAME = "<UNKNOWN_PLAYER>"

Detailed Description

Definition at line 19 of file Player.hpp.


Constructor & Destructor Documentation

yse::Player::Player ( const yap::ID id)
explicit

Definition at line 18 of file Player.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

yse::Player::~Player ( )
virtual

Definition at line 28 of file Player.cpp.

yse::Player::Player ( const Player copy)
protected

Definition at line 32 of file Player.cpp.

Here is the call graph for this function:


Member Function Documentation

void yse::Player::Accept ( yap::IDynamicWorldObjectVisitor visitor)
virtual

Implements yap::IPlayer.

Definition at line 82 of file Player.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yse::Player::Accept ( yap::IDynamicWorldObjectConstVisitor visitor) const
virtual

Implements yap::IPlayer.

Definition at line 89 of file Player.cpp.

Here is the call graph for this function:

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

Implements yap::IPacketHandler.

Definition at line 67 of file Player.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Player * yse::Player::Clone ( ) const
virtual

Reimplemented from yap::WorldObject.

Definition at line 42 of file Player.cpp.

Here is the call graph for this function:

void yse::Player::DestroyObject ( const yap::ID objectWorldID)
virtual

Implements yap::IPlayer.

Definition at line 112 of file Player.cpp.

Here is the call graph for this function:

yse::Player::DISALLOW_ASSIGN ( Player  )
private
const yap::String & yse::Player::GetName ( ) const
virtual

Implements yap::IPlayer.

Definition at line 97 of file Player.cpp.

const yap::String & yse::Player::GetObjectFactoryTypeName ( ) const
protectedvirtual

Implements yap::DynamicWorldObject.

Definition at line 134 of file Player.cpp.

User & yse::Player::GetParent ( )
private

Definition at line 144 of file Player.cpp.

Here is the caller graph for this function:

void yse::Player::HandleClientInfoGameInput ( yap::IPacket packet)
private

Definition at line 149 of file Player.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Implements yap::IPacketHandler.

Definition at line 57 of file Player.cpp.

Here is the call graph for this function:

bool yse::Player::HasInput ( yap::GameInputType  gameInputType) const
virtual

Definition at line 102 of file Player.cpp.

Here is the call graph for this function:

void yse::Player::InitHandlers ( )
private

Definition at line 139 of file Player.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

yap::Event< yap::DynamicWorldObject &, const yap::Vector2 & > & yse::Player::OnMovedEvent ( )
virtual

Implements yap::IPlayer.

Definition at line 129 of file Player.cpp.

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

Implements yap::IPacketHandler.

Definition at line 72 of file Player.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Implements yap::IPacketHandler.

Definition at line 62 of file Player.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yse::Player::SetName ( const yap::String name)

Definition at line 52 of file Player.cpp.

Here is the caller graph for this function:

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

Implements yap::IPacketHandler.

Definition at line 77 of file Player.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yse::Player::SetParentUser ( User parent)

Definition at line 47 of file Player.cpp.

Here is the caller graph for this function:

void yse::Player::TriggerBattle ( )
virtual
Todo:
Battle triggering management.

Implements yap::IPlayer.

Definition at line 117 of file Player.cpp.

Here is the call graph for this function:

void yse::Player::Warp ( const yap::ID mapWorldID,
const yap::Vector2 point 
)
virtual

Implements yap::IPlayer.

Definition at line 107 of file Player.cpp.

Here is the call graph for this function:


Member Data Documentation

const yap::String yse::Player::DEFAULT_NAME = "<UNKNOWN_PLAYER>"
staticprivate

Definition at line 86 of file Player.hpp.

PlayerInputManager yse::Player::inputManager_
private

Definition at line 94 of file Player.hpp.

yap::String yse::Player::name_
private

Definition at line 90 of file Player.hpp.

const yap::String yse::Player::OBJECT_FACTORY_TYPE_NAME = "Player"
staticprivate

Definition at line 84 of file Player.hpp.

yap::PacketHandler yse::Player::packetHandler_
private

Definition at line 92 of file Player.hpp.

User* yse::Player::parentUser_
private

Definition at line 88 of file Player.hpp.


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