4 #include <Eris/Types.h> 5 #include <Eris/EntityRef.h> 7 #include <Atlas/Objects/ObjectsFwd.h> 9 #include <wfmath/point.h> 10 #include <wfmath/vector.h> 11 #include <wfmath/quaternion.h> 12 #include <wfmath/timestamp.h> 14 #include <sigc++/trackable.h> 15 #include <sigc++/signal.h> 16 #include <sigc++/connection.h> 31 class Avatar :
virtual public sigc::trackable
37 const std::string &
getId()
const;
42 View* getView()
const;
58 void drop(
Entity* entity,
const WFMath::Point<3>& pos,
59 const WFMath::Quaternion& orientation,
const std::string& loc);
67 void drop(
Entity* entity,
const WFMath::Vector<3>& offset = WFMath::Vector<3>(0, 0, 0),
68 const WFMath::Quaternion& orientation = WFMath::Quaternion());
77 void say(
const std::string&);
82 void sayTo(
const std::string& message,
const std::vector<const Entity*>& entities);
85 void emote(
const std::string&);
94 void moveInDirection(
const WFMath::Vector<3>&,
const WFMath::Quaternion&);
109 const WFMath::Quaternion& orientation = WFMath::Quaternion());
124 void useOn(
Entity * entity,
const WFMath::Point< 3 > & position,
const std::string& op);
185 sigc::signal<void, Entity*, const Atlas::Objects::Operation::RootOperation&>
Hear;
210 void onEntityAppear(
Entity* ent);
211 void onCharacterChildAdded(
Entity* child);
212 void onCharacterChildRemoved(
Entity* child);
219 void onCharacterWield(
const Atlas::Message::Element&);
220 void onWieldedChanged();
222 virtual void onTransferRequested(
const TransferInfo &transfer);
224 void logoutResponse(
const Atlas::Objects::Operation::RootOperation&);
242 std::string m_entityId;
245 WFMath::TimeStamp m_stampAtLastOp;
253 sigc::connection m_entityAppearanceCon;
268 inline View* Avatar::getView()
const 273 inline const EntityRef& Avatar::getWielded()
const sigc::signal< void, Entity * > InvAdded
An object was added to the inventory.
Definition: Avatar.h:179
void useOn(Entity *entity, const WFMath::Point< 3 > &position, const std::string &op)
Use the currently wielded entity (tool) on another entity.
Definition: Avatar.cpp:296
const std::string & getId() const
Get the Entity id of this Avatar.
Definition: Avatar.h:258
Definition: EntityRef.h:14
void moveInDirection(const WFMath::Vector< 3 > &)
Set the character's velocity.
Definition: Avatar.cpp:196
sigc::signal< void, Entity * > GotCharacterEntity
Emitted when the character entity of this Avatar is valid (and presumably, visible).
Definition: Avatar.h:170
void setIsAdmin(bool isAdmin)
Sets whether the current avatar is an admin character.
Definition: Avatar.cpp:456
void logoutRequested()
Called when a logout of the avatar has been requested by the server.
Definition: Avatar.cpp:445
void onAvatarEntityDeleted()
Called when the avatar entity is deleted.
Definition: Avatar.cpp:363
View encapsulates the set of entities currently visible to an Avatar, as well as those that have rece...
Definition: View.h:33
void emote(const std::string &)
Emote something (in-game)
Definition: Avatar.cpp:167
Definition: IGRouter.h:13
void updateWorldTime(double t)
called by the IG router for each op it sees with a valid 'seconds' attribute set. ...
Definition: Avatar.cpp:406
Definition: Account.cpp:35
void place(Entity *entity, Entity *container, const WFMath::Point< 3 > &pos, const WFMath::Quaternion &orientation=WFMath::Quaternion())
Place an entity inside another one.
Definition: Avatar.cpp:246
sigc::signal< void, Entity *, const Atlas::Objects::Operation::RootOperation & > Hear
emitted when this Avatar hears something.
Definition: Avatar.h:185
void drop(Entity *entity, const WFMath::Point< 3 > &pos, const WFMath::Quaternion &orientation, const std::string &loc)
Drop an entity in the Avatar's inventory at the given location.
Definition: Avatar.cpp:78
void say(const std::string &)
Say something (in-game)
Definition: Avatar.cpp:137
Definition: Account.cpp:33
Underlying Atlas connection, providing a send interface, and receive (dispatch) system.
Definition: Connection.h:37
Avatar(Account &pl, const std::string &entId)
Create a new Avatar object.
Definition: Avatar.cpp:38
void attack(Entity *entity)
Attach the specified entity.
Definition: Avatar.cpp:325
void wield(Entity *entity)
Wield an entity which is inside the Avatar's inventory.
Definition: Avatar.cpp:277
void touch(Entity *)
Touch an entity.
Definition: Avatar.cpp:125
Encapsulates all the state of an Atlas Account, and methods that operation on that state...
Definition: Account.h:44
Entity is a concrete (instantiable) class representing one game entity.
Definition: Entity.h:57
bool getIsAdmin()
Gets whether the current avatar is an admin character.
Definition: Avatar.cpp:461
A TransferInfo object represents the encapsulation of various data required to successfully transfer ...
Definition: TransferInfo.h:16
sigc::signal< void, Entity * > InvRemoved
An object was removed from the inventory.
Definition: Avatar.h:181
void useStop()
Stop the current task, if one is in progress.
Definition: Avatar.cpp:338
void moveToPoint(const WFMath::Point< 3 > &)
Have the character move towards a position.
Definition: Avatar.cpp:182
The player's avatar representation.
Definition: Avatar.h:31
void take(Entity *)
Move an entity into the Avatar's inventory.
Definition: Avatar.cpp:108
void sayTo(const std::string &message, const std::vector< const Entity * > &entities)
Say something (in-game), addressing one or many entities.
Definition: Avatar.cpp:149
double getWorldTime()
get the current local approximation of world time.
Definition: Avatar.cpp:400
sigc::signal< void, const TransferInfo & > TransferRequested
Emitted when a character transfer authentication is requested.
Definition: Avatar.h:192
EntityPtr getEntity() const
Get the Entity this Avatar refers to.
Definition: Avatar.h:263