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

#include <DynamicWorldObject.hpp>

Inheritance diagram for yap::DynamicWorldObject:
Collaboration diagram for yap::DynamicWorldObject:

List of all members.

Public Member Functions

virtual ~DynamicWorldObject ()
virtual void Accept (IDynamicWorldObjectVisitor &visitor)
virtual void Accept (IDynamicWorldObjectConstVisitor &visitor) const
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
IUpdateable members.
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
virtual WorldObjectClone () 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 Attributes

Events.
Event< DynamicWorldObject
&, const Vector2 & > 
OnMoved
Event< DynamicWorldObject
&, const ChangeEventArgs
< const Vector2 & > & > 
OnVelocityChanged
Event< DynamicWorldObject
&, const ChangeEventArgs
< const String & > & > 
OnStateChanged

Static Public Attributes

static const Vector2 DEFAULT_MAX_VELOCITY

Protected Member Functions

 DynamicWorldObject (const ID &id)
 DynamicWorldObject (const DynamicWorldObject &copy)
virtual const StringGetObjectFactoryTypeName () const =0
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)
virtual void HandleOnVelocityChanged (const Vector2 &oldVelocity, const Vector2 &currentVelocity)
- 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 (DynamicWorldObject)
void SetState (const String &state)

Private Attributes

ID worldID_
WorldObjectState state_
PhysicsCorephysicsCore_
Vector2 maxVelocity_
collection::List< MapEvent * > events_
EventTriggerBoundingBoxCollection triggerBoundingBoxes_
 Boxes that belong to this DynamicWorldObject and can trigger events.
EventBoundingBoxCollection sourceBoundingBoxes_
 Boxes that belong to an event and can be triggered.

Static Private Attributes

static const String DEFAULT_INACTIVE_STATE = "Inactive"

Detailed Description

Definition at line 21 of file DynamicWorldObject.hpp.


Constructor & Destructor Documentation

yap::DynamicWorldObject::~DynamicWorldObject ( )
virtual

Definition at line 30 of file DynamicWorldObject.cpp.

yap::DynamicWorldObject::DynamicWorldObject ( const ID id)
explicitprotected

Definition at line 15 of file DynamicWorldObject.cpp.

yap::DynamicWorldObject::DynamicWorldObject ( const DynamicWorldObject copy)
protected

Definition at line 36 of file DynamicWorldObject.cpp.

Here is the call graph for this function:


Member Function Documentation

void yap::DynamicWorldObject::Accept ( IDynamicWorldObjectVisitor visitor)
virtual

Reimplemented in yse::Player, ycl::Player, yap::DestructibleObject, yap::OpenBattleSpawnerArea, yap::Teleporter, and yap::Character.

Definition at line 53 of file DynamicWorldObject.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yap::DynamicWorldObject::Accept ( IDynamicWorldObjectConstVisitor visitor) const
virtual

Reimplemented in yse::Player, ycl::Player, yap::DestructibleObject, yap::OpenBattleSpawnerArea, yap::Teleporter, and yap::Character.

Definition at line 58 of file DynamicWorldObject.cpp.

Here is the call graph for this function:

void yap::DynamicWorldObject::AddEvent ( MapEvent event)

Definition at line 213 of file DynamicWorldObject.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yap::DynamicWorldObject::AddTriggerBoundingBox ( BoundingBox boundingBox)

Definition at line 206 of file DynamicWorldObject.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yap::DynamicWorldObject::ApplyForce ( const Vector2 force)

Definition at line 120 of file DynamicWorldObject.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

yap::DynamicWorldObject::DISALLOW_ASSIGN ( DynamicWorldObject  )
private
void yap::DynamicWorldObject::GetEventsCollidingWith ( const CollidableArea collidableArea,
MapEventQueue events 
) const

Definition at line 227 of file DynamicWorldObject.cpp.

Here is the call graph for this function:

const String & yap::DynamicWorldObject::GetLogicalState ( ) const

Definition at line 147 of file DynamicWorldObject.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

const Vector2 & yap::DynamicWorldObject::GetMaxVelocity ( ) const

Definition at line 81 of file DynamicWorldObject.cpp.

Here is the caller graph for this function:

const Vector2 & yap::DynamicWorldObject::GetMove ( ) const

Definition at line 127 of file DynamicWorldObject.cpp.

Here is the call graph for this function:

virtual const String& yap::DynamicWorldObject::GetObjectFactoryTypeName ( ) const
protectedpure virtual

Implemented in yse::Player, ycl::OpenBattleSpawnerArea, ycl::DestructibleObject, ycl::Teleporter, ycl::Player, yap::DestructibleObject, yse::Teleporter, yap::OpenBattleSpawnerArea, yse::NPC, and ycl::NPC.

Here is the caller graph for this function:

const String & yap::DynamicWorldObject::GetState ( ) const

Definition at line 142 of file DynamicWorldObject.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

const ID & yap::DynamicWorldObject::GetTypeID ( ) const

Returns the ID of this type from the ObjectFactory.

Definition at line 76 of file DynamicWorldObject.cpp.

Here is the call graph for this function:

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

Definition at line 64 of file DynamicWorldObject.cpp.

Here is the caller graph for this function:

void yap::DynamicWorldObject::HandleApplyForce ( const Vector2 force)
protectedvirtual

Definition at line 252 of file DynamicWorldObject.cpp.

Here is the caller graph for this function:

void yap::DynamicWorldObject::HandleMove ( const Vector2 offset)
protectedvirtual

Reimplemented from yap::WorldObject.

Reimplemented in ycl::DestructibleObject, ycl::OpenBattleSpawnerArea, and ycl::Character.

Definition at line 265 of file DynamicWorldObject.cpp.

Here is the call graph for this function:

void yap::DynamicWorldObject::HandleOnVelocityChanged ( const Vector2 oldVelocity,
const Vector2 currentVelocity 
)
protectedvirtual

Reimplemented in yap::Character.

Definition at line 299 of file DynamicWorldObject.cpp.

Here is the caller graph for this function:

void yap::DynamicWorldObject::HandleScale ( const Vector2 factor)
protectedvirtual

Reimplemented from yap::WorldObject.

Definition at line 275 of file DynamicWorldObject.cpp.

Here is the call graph for this function:

void yap::DynamicWorldObject::HandleSetCollidableArea ( CollidableArea collidableArea)
protectedvirtual

Reimplemented from yap::WorldObject.

Definition at line 243 of file DynamicWorldObject.cpp.

Here is the call graph for this function:

void yap::DynamicWorldObject::HandleSetH ( int  h)
protectedvirtual

Reimplemented from yap::WorldObject.

Definition at line 291 of file DynamicWorldObject.cpp.

Here is the call graph for this function:

void yap::DynamicWorldObject::HandleSetState ( const String state)
protectedvirtual

Reimplemented in ycl::Character.

Definition at line 261 of file DynamicWorldObject.cpp.

Here is the caller graph for this function:

void yap::DynamicWorldObject::HandleSetWorldID ( const ID worldID)
protectedvirtual

Reimplemented in yap::DestructibleObject.

Definition at line 239 of file DynamicWorldObject.cpp.

Here is the caller graph for this function:

void yap::DynamicWorldObject::HandleSetZ ( int  z)
protectedvirtual

Reimplemented from yap::WorldObject.

Definition at line 283 of file DynamicWorldObject.cpp.

Here is the call graph for this function:

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

Reimplemented in ycl::OpenBattleSpawnerArea, ycl::DestructibleObject, and ycl::Character.

Definition at line 256 of file DynamicWorldObject.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool yap::DynamicWorldObject::IsActive ( ) const

Definition at line 137 of file DynamicWorldObject.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool yap::DynamicWorldObject::IsMoving ( ) const

Definition at line 201 of file DynamicWorldObject.cpp.

Here is the call graph for this function:

void yap::DynamicWorldObject::RawSetState ( const String state)

Directly changes this DynamicWorldObject state. Used for synchronizing the attribut.

Parameters:
stateState to set to this DynamicWorldObject.

Definition at line 182 of file DynamicWorldObject.cpp.

Here is the call graph for this function:

void yap::DynamicWorldObject::RawSetVelocity ( const Vector2 velocity)

Definition at line 132 of file DynamicWorldObject.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yap::DynamicWorldObject::RemoveEvent ( MapEvent event)

Definition at line 220 of file DynamicWorldObject.cpp.

Here is the call graph for this function:

void yap::DynamicWorldObject::SetInactive ( )

Definition at line 175 of file DynamicWorldObject.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yap::DynamicWorldObject::SetMaxVelocity ( const Vector2 maxVelocity)

Definition at line 86 of file DynamicWorldObject.cpp.

Here is the caller graph for this function:

void yap::DynamicWorldObject::SetPhysicsCore ( PhysicsCore physicsCore)

Definition at line 91 of file DynamicWorldObject.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yap::DynamicWorldObject::SetState ( const String state)
private

Definition at line 187 of file DynamicWorldObject.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yap::DynamicWorldObject::SetWorldID ( const ID id)

Definition at line 69 of file DynamicWorldObject.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool yap::DynamicWorldObject::TryChangeState ( const String state)

Definition at line 152 of file DynamicWorldObject.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Makes the object evolve for one frame of the game.

Parameters:
dtDelta time since the last frame.

Implements yap::IUpdateable.

Definition at line 234 of file DynamicWorldObject.cpp.

Here is the call graph for this function:


Member Data Documentation

const String yap::DynamicWorldObject::DEFAULT_INACTIVE_STATE = "Inactive"
staticprivate

Definition at line 118 of file DynamicWorldObject.hpp.

const Vector2 yap::DynamicWorldObject::DEFAULT_MAX_VELOCITY
static
Initial value:
Vector2 (150.0f, 150.0f)

Definition at line 87 of file DynamicWorldObject.hpp.

collection::List<MapEvent*> yap::DynamicWorldObject::events_
private

Definition at line 127 of file DynamicWorldObject.hpp.

Vector2 yap::DynamicWorldObject::maxVelocity_
private

Definition at line 125 of file DynamicWorldObject.hpp.

Event<DynamicWorldObject&, const Vector2&> yap::DynamicWorldObject::OnMoved

Definition at line 78 of file DynamicWorldObject.hpp.

Event< DynamicWorldObject&, const ChangeEventArgs<const String&>&> yap::DynamicWorldObject::OnStateChanged

Definition at line 84 of file DynamicWorldObject.hpp.

Event< DynamicWorldObject&, const ChangeEventArgs<const Vector2&>&> yap::DynamicWorldObject::OnVelocityChanged

Definition at line 81 of file DynamicWorldObject.hpp.

PhysicsCore* yap::DynamicWorldObject::physicsCore_
private

Definition at line 124 of file DynamicWorldObject.hpp.

EventBoundingBoxCollection yap::DynamicWorldObject::sourceBoundingBoxes_
private

Boxes that belong to an event and can be triggered.

Definition at line 132 of file DynamicWorldObject.hpp.

WorldObjectState yap::DynamicWorldObject::state_
private

Definition at line 122 of file DynamicWorldObject.hpp.

EventTriggerBoundingBoxCollection yap::DynamicWorldObject::triggerBoundingBoxes_
private

Boxes that belong to this DynamicWorldObject and can trigger events.

Definition at line 130 of file DynamicWorldObject.hpp.

ID yap::DynamicWorldObject::worldID_
private

Definition at line 120 of file DynamicWorldObject.hpp.


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