![]() |
YAPOG
0.0.1
Yet Another Pokemon Online Game
|
#include <DynamicWorldObject.hpp>
Public Member Functions | |
| virtual | ~DynamicWorldObject () |
| virtual void | Accept (IDynamicWorldObjectVisitor &visitor) |
| virtual void | Accept (IDynamicWorldObjectConstVisitor &visitor) const |
| const ID & | GetWorldID () const |
| void | SetWorldID (const ID &id) |
| const ID & | GetTypeID () const |
| Returns the ID of this type from the ObjectFactory. | |
| const Vector2 & | GetMaxVelocity () const |
| void | SetMaxVelocity (const Vector2 &maxVelocity) |
| void | SetPhysicsCore (PhysicsCore *physicsCore) |
| void | ApplyForce (const Vector2 &force) |
| const Vector2 & | GetMove () const |
| void | RawSetVelocity (const Vector2 &velocity) |
| const String & | GetState () const |
| const String & | GetLogicalState () 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 ID & | GetID () 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 Vector2 & | GetPosition () const |
| Gets the coordinates in pixels of the origin of this ISpatial from the global origin. | |
| virtual const Vector2 & | GetSize () const |
| Gets the size in pixels of this ISpatial. | |
| virtual const Vector2 & | GetTopLeft () const |
| virtual const Vector2 & | GetBottomRight () const |
| virtual const Vector2 & | GetCenter () const |
| virtual const FloatRect & | GetRectangle () 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 WorldObject * | Clone () 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 ©) | |
| virtual const String & | GetObjectFactoryTypeName () 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 ¤tVelocity) |
Protected Member Functions inherited from yap::WorldObject | |
| WorldObject (const ID &id) | |
| WorldObject (const WorldObject ©) | |
| 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_ |
| PhysicsCore * | physicsCore_ |
| 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" |
Definition at line 21 of file DynamicWorldObject.hpp.
|
virtual |
Definition at line 30 of file DynamicWorldObject.cpp.
|
explicitprotected |
Definition at line 15 of file DynamicWorldObject.cpp.
|
protected |
|
virtual |
Reimplemented in yse::Player, ycl::Player, yap::DestructibleObject, yap::OpenBattleSpawnerArea, yap::Teleporter, and yap::Character.
Definition at line 53 of file DynamicWorldObject.cpp.
|
virtual |
Reimplemented in yse::Player, ycl::Player, yap::DestructibleObject, yap::OpenBattleSpawnerArea, yap::Teleporter, and yap::Character.
Definition at line 58 of file DynamicWorldObject.cpp.
| void yap::DynamicWorldObject::AddEvent | ( | MapEvent * | event | ) |
Definition at line 213 of file DynamicWorldObject.cpp.
| void yap::DynamicWorldObject::AddTriggerBoundingBox | ( | BoundingBox * | boundingBox | ) |
Definition at line 206 of file DynamicWorldObject.cpp.
| void yap::DynamicWorldObject::ApplyForce | ( | const Vector2 & | force | ) |
Definition at line 120 of file DynamicWorldObject.cpp.
|
private |
| void yap::DynamicWorldObject::GetEventsCollidingWith | ( | const CollidableArea & | collidableArea, |
| MapEventQueue & | events | ||
| ) | const |
| const String & yap::DynamicWorldObject::GetLogicalState | ( | ) | const |
Definition at line 147 of file DynamicWorldObject.cpp.
| const Vector2 & yap::DynamicWorldObject::GetMaxVelocity | ( | ) | const |
| const Vector2 & yap::DynamicWorldObject::GetMove | ( | ) | 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.
| const String & yap::DynamicWorldObject::GetState | ( | ) | const |
Definition at line 142 of file DynamicWorldObject.cpp.
| const ID & yap::DynamicWorldObject::GetTypeID | ( | ) | const |
Returns the ID of this type from the ObjectFactory.
Definition at line 76 of file DynamicWorldObject.cpp.
| const ID & yap::DynamicWorldObject::GetWorldID | ( | ) | const |
|
protectedvirtual |
|
protectedvirtual |
Reimplemented from yap::WorldObject.
Reimplemented in ycl::DestructibleObject, ycl::OpenBattleSpawnerArea, and ycl::Character.
Definition at line 265 of file DynamicWorldObject.cpp.
|
protectedvirtual |
Reimplemented in yap::Character.
Definition at line 299 of file DynamicWorldObject.cpp.
|
protectedvirtual |
Reimplemented from yap::WorldObject.
Definition at line 275 of file DynamicWorldObject.cpp.
|
protectedvirtual |
Reimplemented from yap::WorldObject.
Definition at line 243 of file DynamicWorldObject.cpp.
|
protectedvirtual |
Reimplemented from yap::WorldObject.
Definition at line 291 of file DynamicWorldObject.cpp.
|
protectedvirtual |
Reimplemented in ycl::Character.
Definition at line 261 of file DynamicWorldObject.cpp.
|
protectedvirtual |
Reimplemented in yap::DestructibleObject.
Definition at line 239 of file DynamicWorldObject.cpp.
|
protectedvirtual |
Reimplemented from yap::WorldObject.
Definition at line 283 of file DynamicWorldObject.cpp.
|
protectedvirtual |
Reimplemented in ycl::OpenBattleSpawnerArea, ycl::DestructibleObject, and ycl::Character.
Definition at line 256 of file DynamicWorldObject.cpp.
| bool yap::DynamicWorldObject::IsActive | ( | ) | const |
Definition at line 137 of file DynamicWorldObject.cpp.
| bool yap::DynamicWorldObject::IsMoving | ( | ) | const |
| void yap::DynamicWorldObject::RawSetState | ( | const String & | state | ) |
Directly changes this DynamicWorldObject state. Used for synchronizing the attribut.
| state | State to set to this DynamicWorldObject. |
Definition at line 182 of file DynamicWorldObject.cpp.
| void yap::DynamicWorldObject::RawSetVelocity | ( | const Vector2 & | velocity | ) |
Definition at line 132 of file DynamicWorldObject.cpp.
| void yap::DynamicWorldObject::RemoveEvent | ( | MapEvent * | event | ) |
| void yap::DynamicWorldObject::SetInactive | ( | ) |
Definition at line 175 of file DynamicWorldObject.cpp.
| void yap::DynamicWorldObject::SetMaxVelocity | ( | const Vector2 & | maxVelocity | ) |
| void yap::DynamicWorldObject::SetPhysicsCore | ( | PhysicsCore * | physicsCore | ) |
Definition at line 91 of file DynamicWorldObject.cpp.
|
private |
Definition at line 187 of file DynamicWorldObject.cpp.
| void yap::DynamicWorldObject::SetWorldID | ( | const ID & | id | ) |
Definition at line 69 of file DynamicWorldObject.cpp.
| bool yap::DynamicWorldObject::TryChangeState | ( | const String & | state | ) |
Definition at line 152 of file DynamicWorldObject.cpp.
|
virtual |
Makes the object evolve for one frame of the game.
| dt | Delta time since the last frame. |
Implements yap::IUpdateable.
Definition at line 234 of file DynamicWorldObject.cpp.
|
staticprivate |
Definition at line 118 of file DynamicWorldObject.hpp.
|
static |
Definition at line 87 of file DynamicWorldObject.hpp.
|
private |
Definition at line 127 of file DynamicWorldObject.hpp.
|
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.
|
private |
Definition at line 124 of file DynamicWorldObject.hpp.
|
private |
Boxes that belong to an event and can be triggered.
Definition at line 132 of file DynamicWorldObject.hpp.
|
private |
Definition at line 122 of file DynamicWorldObject.hpp.
|
private |
Boxes that belong to this DynamicWorldObject and can trigger events.
Definition at line 130 of file DynamicWorldObject.hpp.
|
private |
Definition at line 120 of file DynamicWorldObject.hpp.