eris 1.4.0
A WorldForge client library.
|
#include <Room.h>
Public Types | |
enum | RouterResult { IGNORED = 0 , HANDLED } |
Public Member Functions | |
Room (Lobby *l, const std::string &id) | |
void | say (const std::string &tk) |
Send a piece of text to this room. More... | |
void | emote (const std::string &em) |
void | leave () |
Room * | createRoom (const std::string &name) |
std::string | getName () const |
Obtain the human-readable name of this room. More... | |
std::string | getTopic () const |
std::vector< Person * > | getPeople () const |
obtain an array of pointers to everyone in this room More... | |
std::vector< Room * > | getRooms () const |
Obtain a list of rooms within this room. More... | |
std::string | getId () const |
Person * | getPersonByUID (const std::string &uid) |
virtual RouterResult | handleObject (const Atlas::Objects::Root &obj) |
virtual RouterResult | handleEntity (const Atlas::Objects::Entity::RootEntity &ent) |
Public Attributes | |
sigc::signal< void, Room * > | Entered |
sigc::signal< void, Room *, Person *, const std::string & > | Speech |
sigc::signal< void, Room *, Person *, const std::string & > | Emote |
sigc::signal< void, Room *, Person * > | Appearance |
sigc::signal< void, Room *, Person * > | Disappearance |
Similarly, emitted when the specifed person leaves the room. More... | |
Protected Types | |
typedef std::unordered_map< std::string, std::unique_ptr< Person > > | IdPersonMap |
Protected Member Functions | |
RouterResult | handleOperation (const Atlas::Objects::Operation::RootOperation &op) override |
void | handleSoundTalk (Person *p, const std::string &speech) |
void | handleEmote (Person *p, const std::string &desc) |
Protected Attributes | |
std::string | m_roomId |
Friends | |
class | Lobby |
The out-of-game (OOG) heirarchy is composed of Rooms, containing Persons and other Rooms. Generally rooms corespond to chanels in IRC, and the interface and commands should be clear if you are familiar with that medium.
|
protected |
|
explicit |
standard constructor. Issues a LOOK against the specified ID, and sets up the necessary signals to drive the Room if id arg is provided
Definition at line 29 of file Room.cpp.
References Eris::Lobby::getConnection().
Room * Eris::Room::createRoom | ( | const std::string & | name | ) |
create a child room of this one, with the specified name. Note that most attributes, including the ID will not be valid until the new room emits the 'Entered' signal. If you need a unique, referenceable indentifier earlier than that point, use the pointer value.
Definition at line 112 of file Room.cpp.
References Eris::Lobby::getAccount(), Eris::Lobby::getConnection(), Eris::Account::getId(), Eris::getNewSerialno(), Eris::BaseConnection::isConnected(), and Eris::Connection::send().
void Eris::Room::emote | ( | const std::string & | em | ) |
Send an emote ( /me ) to the room. This is transmitted as an IMAGINARY op in Atlas, with args[0]["id"] = "emote".
Definition at line 69 of file Room.cpp.
References emote(), Eris::Lobby::getAccount(), Eris::Lobby::getConnection(), Eris::Account::getId(), Eris::getNewSerialno(), Eris::BaseConnection::isConnected(), and Eris::Connection::send().
Referenced by emote().
|
inline |
Get the Atlas object ID of the Room; note that this may return an empty value if called prior to entering the Lobby
Definition at line 74 of file Room.h.
Referenced by Eris::Lobby::~Lobby().
|
inline |
std::vector< Person * > Eris::Room::getPeople | ( | ) | const |
Person * Eris::Room::getPersonByUID | ( | const std::string & | uid | ) |
|
inline |
|
protected |
|
virtualinherited |
Definition at line 39 of file Router.cpp.
|
virtualinherited |
Definition at line 22 of file Router.cpp.
|
overrideprotectedvirtual |
Reimplemented from Eris::Router.
|
protected |
void Eris::Room::leave | ( | ) |
Leave the room - no more signals will be emitted for this room again (validity of Room pointer after this call?)
Definition at line 92 of file Room.cpp.
References Eris::Lobby::getAccount(), Eris::Lobby::getConnection(), Eris::Account::getId(), Eris::getNewSerialno(), Eris::BaseConnection::isConnected(), and Eris::Connection::send().
void Eris::Room::say | ( | const std::string & | tk | ) |
Send a piece of text to this room.
Definition at line 48 of file Room.cpp.
References Eris::Lobby::getAccount(), Eris::Lobby::getConnection(), Eris::Account::getId(), Eris::getNewSerialno(), Eris::BaseConnection::isConnected(), and Eris::Connection::send().
sigc::signal<void, Room*> Eris::Room::Entered |