Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

Room.h

00001 #ifndef ERIS_ROOM_H 00002 #define ERIS_ROOM_H 00003 00004 #include <Eris/Types.h> 00005 00006 #include <sigc++/object.h> 00007 #include <sigc++/signal.h> 00008 00009 namespace Atlas { namespace Objects { 00010 namespace Operation { 00011 class Imaginary; 00012 class Talk; 00013 class Appearance; 00014 class Disappearance; 00015 } 00016 namespace Entity { 00017 class RootEntity; 00018 } 00019 }} 00020 00021 namespace Eris 00022 { 00023 00024 // forward decls 00025 class Person; 00026 class Lobby; 00027 00032 class Room : virtual public SigC::Object 00033 { 00034 public: 00035 virtual ~Room(); 00036 00038 void say(const std::string &tk); 00039 00042 void emote(const std::string &em); 00043 00046 void leave(); 00047 00052 Room* createRoom(const std::string &name); 00053 00055 const std::string& getName() const 00056 { return _name; } 00057 00059 StringList getPeople() const 00060 { return StringList(_people.begin(), _people.end()); } 00061 00063 StringList getRooms() const 00064 { return StringList(_subrooms.begin(), _subrooms.end()); } 00065 00069 const std::string& getID() const; 00070 00072 Lobby* getLobby() const {return _lobby;} 00073 00074 Person* getPersonByUID(const std::string& uid); 00075 00077 void sight(const Atlas::Objects::Entity::RootEntity &room); 00078 // signals 00081 SigC::Signal1<void, Room*> Entered; 00082 00085 SigC::Signal3<void, Room*, const std::string&, const std::string&> Talk; 00086 00088 SigC::Signal3<void, Room*, const std::string&, const std::string&> Emote; 00089 00093 SigC::Signal2<void, Room*, const std::string&> Appearance; 00095 SigC::Signal2<void, Room*, const std::string&> Disappearance; 00096 00098 SigC::Signal1<void, const StringSet&> Changed; 00099 00100 protected: 00101 friend class Lobby; // so Lobby can call the constructor 00102 00105 explicit Room(Lobby *l, const std::string &id = ""); 00106 00109 void setup(); 00110 00112 void notifyPersonSight(Person *p); 00113 00114 // Callbacks 00115 void recvSoundTalk(const Atlas::Objects::Operation::Talk &tk); 00116 void recvAppear(const Atlas::Objects::Operation::Appearance &ap); 00117 void recvDisappear(const Atlas::Objects::Operation::Disappearance &dis); 00118 void recvSightImaginary(const Atlas::Objects::Operation::Imaginary &im); 00119 00120 std::string _id; 00121 Lobby* _lobby; 00122 bool _parted; 00123 00124 std::string _name, 00125 _creator; 00126 bool _initialGet; 00127 00128 StringSet _subrooms; 00129 StringSet _people, 00130 _pending; 00131 }; 00132 00133 } 00134 00135 #endif

Generated on Thu Jul 29 08:12:34 2004 for Eris by doxygen 1.3.7