Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

Room.h

00001 #ifndef ERIS_ROOM_H
00002 #define ERIS_ROOM_H
00003 
00004 #include <sigc++/object.h>
00005 #include <sigc++/object_slot.h>
00006 #if SIGC_MAJOR_VERSION == 1 && SIGC_MINOR_VERSION == 0
00007 #include <sigc++/basic_signal.h>
00008 #else
00009 #include <sigc++/signal.h>
00010 #endif
00011 
00012 #include <Atlas/Objects/Entity/RootEntity.h>
00013 #include <Atlas/Objects/Operation/Talk.h>
00014 #include <Atlas/Objects/Operation/Appearance.h>
00015 #include <Atlas/Objects/Operation/Disappearance.h>
00016 
00017 namespace Atlas { namespace Objects {
00018 
00019         namespace Operation {
00020                 class Imaginary;
00021         }
00022         
00023 }}
00024 
00025 #include <Eris/Types.h>
00026 
00027 namespace Eris
00028 {
00029         
00030 // forward decls
00031 class Person;
00032 class Lobby;
00033 
00038 class Room : virtual public SigC::Object
00039 {
00040 public: 
00041         virtual ~Room();
00042 
00044         void say(const std::string &tk);
00045 
00048         void emote(const std::string &em);
00049 
00052         void leave();
00053 
00058     Room* createRoom(const std::string &name);
00059 
00061         const std::string& getName() const
00062         { return _name; }
00063         
00065         StringList getPeople() const
00066         { return StringList(_people.begin(), _people.end()); }
00067         
00069         StringList getRooms() const
00070         { return StringList(_subrooms.begin(), _subrooms.end()); }
00071         
00075         const std::string& getID() const;
00076         
00078         void sight(const Atlas::Objects::Entity::RootEntity &room);     
00079 // signals
00082         SigC::Signal1<void, Room*> Entered;
00083         
00086         SigC::Signal3<void, Room*, const std::string&, const std::string&> Talk;
00087         
00089         SigC::Signal3<void, Room*, const std::string&, const std::string&> Emote;
00090         
00094         SigC::Signal2<void, Room*, const std::string&> Appearance;
00096         SigC::Signal2<void, Room*, const std::string&> Disappearance;
00097         
00099         SigC::Signal1<void, const StringSet&> Changed;
00100         
00101 protected:
00102         friend class Lobby;     // so Lobby can call the constructor
00103                 
00106         explicit Room(Lobby *l, const std::string &id = "");
00107 
00110         void setup();
00111 
00113         void notifyPersonSight(Person *p);
00114 
00115         // Callbacks
00116         void recvSoundTalk(const Atlas::Objects::Operation::Talk &tk);
00117         void recvAppear(const Atlas::Objects::Operation::Appearance &ap);
00118         void recvDisappear(const Atlas::Objects::Operation::Disappearance &dis);
00119         void recvSightImaginary(const Atlas::Objects::Operation::Imaginary &im);
00120 
00121         std::string _id;        
00122         Lobby* _lobby;          
00123         bool _parted;           
00124 
00125         std::string _name,      
00126                 _creator;       
00127         bool _initialGet;
00128 
00129         StringSet _subrooms;    
00130         StringSet _people,              
00131                 _pending;       
00132 };
00133         
00134 }
00135 
00136 #endif

Generated on Thu May 22 08:01:04 2003 for Eris by doxygen1.3-rc3