Eris::Avatar Class Reference

The players avatar representation. More...

#include <Avatar.h>

List of all members.

Public Member Functions

const std::string & getId () const
 Get the Entity id of this Avatar.
EntityPtr getEntity () const
 Get the Entity this Avatar refers to.
ViewgetView () const
ConnectiongetConnection () const
double getWorldTime ()
 get the current local approximation of world time.
const EntityRef & getWielded () const
void drop (Entity *, const WFMath::Point< 3 > &pos, const std::string &loc)
 Drop an object in the Avatar's inventory at the given location.
void drop (Entity *, const WFMath::Vector< 3 > &offset=WFMath::Vector< 3 >(0, 0, 0))
 Drop an object in the Avatar's inventory at the Avatar's feet.
void take (Entity *)
 Move an entity into the Avatar's inventory.
void touch (Entity *)
 Touch an entity.
void say (const std::string &)
 Say something (in-game).
void emote (const std::string &)
 Emote something (in-game).
void moveToPoint (const WFMath::Point< 3 > &)
 Have the character move towards a position.
void moveInDirection (const WFMath::Vector< 3 > &)
 Set the character's velocity.
void moveInDirection (const WFMath::Vector< 3 > &, const WFMath::Quaternion &)
 Set the character's velocity and orientation.
void place (Entity *, Entity *container, const WFMath::Point< 3 > &pos=WFMath::Point< 3 >(0, 0, 0))
 Place an entity inside another one.
void wield (Entity *entity)
 Wield an entity which is inside the Avatar's inventory.
void useOn (Entity *entity, const WFMath::Point< 3 > &position, const std::string &op)
 Use the currently wielded entity (tool) on another entity.
void attack (Entity *entity)
 Attach the specified entity.
void useStop ()
 Stop the current task, if one is in progress.
void deactivate ()

Public Attributes

sigc::signal< void, Entity * > GotCharacterEntity
 Emitted when the character entity of this Avatar is valid (and presumably, visible).
sigc::signal< void, Entity * > InvAdded
 An object was added to the inventory.
sigc::signal< void, Entity * > InvRemoved
 An object was removed from the inventory.
sigc::signal< void, Entity *,
const Atlas::Objects::Operation::RootOperation & > 
Hear
 emitted when this Avatar hears something.

Protected Member Functions

 Avatar (Account *pl, const std::string &entId)
 Create a new Avatar object.
void updateWorldTime (double t)
 called by the IG router for each op it sees with a valid 'seconds' attribute set.
void onEntityAppear (Entity *ent)
void onCharacterChildAdded (Entity *child)
void onCharacterChildRemoved (Entity *child)
void onCharacterWield (const Atlas::Message::Element &)
void onWieldedChanged ()
void logoutResponse (const Atlas::Objects::Operation::RootOperation &)

Protected Attributes

Accountm_account
std::string m_entityId
EntityPtr m_entity
WFMath::TimeStamp m_stampAtLastOp
double m_lastOpTime
IGRouter * m_router
Viewm_view
TypeInfoArray m_useOps
EntityRef m_wielded
sigc::connection m_entityAppearanceCon

Friends

class Account
class AccountRouter
class IGRouter


Detailed Description

The players avatar representation.


Constructor & Destructor Documentation

Eris::Avatar::Avatar ( Account pl,
const std::string &  entId 
) [protected]

Create a new Avatar object.

Parameters:
pl The player that owns the Avatar


Member Function Documentation

double Eris::Avatar::getWorldTime (  ) 

get the current local approximation of world time.

void Eris::Avatar::useOn ( Entity entity,
const WFMath::Point< 3 > &  position,
const std::string &  op 
)

Use the currently wielded entity (tool) on another entity.

Parameters:
entity A pointer to the entity you wish to use your tool on.
position A position where you perform the operation.
op The operation of the tool to perform, or an empty string to use the default.
If position is invalid the "pos" parameter will not be set on the USE operation.

See also:
WFMath::Point< 3 >::Point(), WFMath::Point< 3 >::setValid(), WFMath::Point< 3 >::isValid()

void Eris::Avatar::attack ( Entity entity  ) 

Attach the specified entity.

Parameters:
entity The entity to be attacked

void Eris::Avatar::useStop (  ) 

Stop the current task, if one is in progress.

This could be either a useOn or attack.

void Eris::Avatar::updateWorldTime ( double  t  )  [protected]

called by the IG router for each op it sees with a valid 'seconds' attribute set.

We use this to synchronize the local world time up.


Member Data Documentation

sigc::signal<void, Entity*> Eris::Avatar::GotCharacterEntity

Emitted when the character entity of this Avatar is valid (and presumably, visible).

This will happen some time after the InGame signal is emitted. A client might wish to show some kind of 'busy' animation, eg an hour-glass, while waiting for this signal.

sigc::signal<void, Entity*, const Atlas::Objects::Operation::RootOperation&> Eris::Avatar::Hear

emitted when this Avatar hears something.

Passes the source of the sound, and the operation that was heard, for example a Talk.


The documentation for this class was generated from the following files:
Generated on Sun Dec 16 13:06:23 2007 for Eris by  doxygen 1.5.2