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> 18 #include <boost/optional.hpp> 34 class Avatar :
virtual public sigc::trackable
39 const std::string &
getId()
const;
42 const std::string & getEntityId()
const;
48 View* getView()
const;
62 void drop(
Entity* entity,
const WFMath::Point<3>& pos,
63 const WFMath::Quaternion& orientation,
const std::string& loc);
71 void drop(
Entity* entity,
const WFMath::Vector<3>& offset = WFMath::Vector<3>(0, 0, 0),
72 const WFMath::Quaternion& orientation = WFMath::Quaternion());
81 void say(
const std::string&);
86 void sayTo(
const std::string& message,
const std::vector<std::string>& entities);
89 void emote(
const std::string&);
92 void moveToPoint(
const WFMath::Point<3>&,
const WFMath::Quaternion& orient);
95 void moveInDirection(
const WFMath::Vector<3>&,
const WFMath::Quaternion&);
110 const WFMath::Quaternion& orientation = WFMath::Quaternion(),
111 boost::optional<float> offset = boost::none);
169 void send(
const Atlas::Objects::Operation::RootOperation& op);
192 sigc::signal<void, Entity*, const Atlas::Objects::Operation::RootOperation&>
Hear;
207 Avatar(
Account& pl, std::string mindId, std::string entityId);
218 void onEntityAppear(
Entity* ent);
219 void onCharacterChildAdded(
Entity* child);
220 void onCharacterChildRemoved(
Entity* child);
226 virtual void onTransferRequested(
const TransferInfo &transfer);
228 void logoutResponse(
const Atlas::Objects::Operation::RootOperation&);
246 std::string m_mindId;
247 std::string m_entityId;
250 WFMath::TimeStamp m_stampAtLastOp;
256 sigc::connection m_entityAppearanceCon;
268 inline const std::string & Avatar::getEntityId()
const 279 inline View* Avatar::getView()
const sigc::signal< void, Entity * > InvAdded
An object was added to the inventory.
Definition: Avatar.h:186
Class for things which occur after a period of time.
Definition: EventService.h:23
sigc::signal< void, Entity * > GotCharacterEntity
Emitted when the character entity of this Avatar is valid (and presumably, visible).
Definition: Avatar.h:177
void setIsAdmin(bool isAdmin)
Sets whether the current avatar is an admin character.
Definition: Avatar.cpp:434
void logoutRequested()
Called when a logout of the avatar has been requested by the server.
Definition: Avatar.cpp:423
void touch(Entity *, const WFMath::Point< 3 > &pos)
Touch an entity.
Definition: Avatar.cpp:134
void onAvatarEntityDeleted()
Called when the avatar entity is deleted.
Definition: Avatar.cpp:353
void sayTo(const std::string &message, const std::vector< std::string > &entities)
Say something (in-game), addressing one or many entities.
Definition: Avatar.cpp:161
View encapsulates the set of entities currently visible to an Avatar, as well as those that have rece...
Definition: View.h:37
void place(Entity *entity, Entity *container, const WFMath::Point< 3 > &pos, const WFMath::Quaternion &orientation=WFMath::Quaternion(), boost::optional< float > offset=boost::none)
Place an entity inside another one.
Definition: Avatar.cpp:232
void emote(const std::string &)
Emote something (in-game)
Definition: Avatar.cpp:179
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:385
Definition: Account.cpp:36
sigc::signal< void, Entity *, const Atlas::Objects::Operation::RootOperation & > Hear
emitted when this Avatar hears something.
Definition: Avatar.h:192
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:87
void say(const std::string &)
Say something (in-game)
Definition: Avatar.cpp:149
Every Eris class and type lives inside the Eris namespace; certain utility functions live in the Util...
Definition: Account.cpp:34
Underlying Atlas connection, providing a send interface, and receive (dispatch) system.
Definition: Connection.h:36
void attack(Entity *entity)
Use the currently wielded entity (tool) on another entity.
Definition: Avatar.cpp:312
const std::string & getId() const
Get the Mind id of this Avatar. All interaction with the entity goes through the Mind.
Definition: Avatar.h:263
void send(const Atlas::Objects::Operation::RootOperation &op)
Sends an operation from this Avatar.
Definition: Avatar.cpp:444
void moveToPoint(const WFMath::Point< 3 > &, const WFMath::Quaternion &orient)
Have the character move towards a position. Any non-valid data will not be sent.
Definition: Avatar.cpp:194
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:58
bool getIsAdmin()
Gets whether the current avatar is an admin character.
Definition: Avatar.cpp:439
void moveInDirection(const WFMath::Vector< 3 > &, const WFMath::Quaternion &)
Set the character's velocity and orientation. Any non-valid data will not be sent.
Definition: Avatar.cpp:214
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:188
EntityPtr getEntity() const
Get the Entity this Avatar refers to.
Definition: Avatar.h:274
void useStop()
Stop the current task, if one is in progress.
Definition: Avatar.cpp:325
Avatar(Account &pl, std::string mindId, std::string entityId)
Create a new Avatar object.
Definition: Avatar.cpp:39
The player's avatar representation.
Definition: Avatar.h:34
void take(Entity *)
Move an entity into the Avatar's inventory.
Definition: Avatar.cpp:117
double getWorldTime()
get the current local approximation of world time.
Definition: Avatar.cpp:379
sigc::signal< void, const TransferInfo & > TransferRequested
Emitted when a character transfer authentication is requested.
Definition: Avatar.h:199