#ifndef __ROOM_H_
#define __ROOM_H_
#include "avatar.h"
#include <iostream>
#include <map>
#ifndef ROOM_VERSION
#define ROOM_VERSION 1
#endif
using namespace std;
class Room;
typedef std::map<std::string, Room *> RoomMap;
bool CheckVnumRange( Avatar *av, const string& str );
string GenOppDir( string dir, string* str = NULL );
class Room
{
public:
Room(unsigned int rid);
Room( const string& );
~Room();
unsigned int id;
RoomMap GetExits() const { return exits; }
Room * GetExit(string dir) { return exits[dir]; }
void AddExit( string s, Room *r );
void RemExit( string s );
void InsertAvatar( Avatar *a, bool look = true );
void Broadcast( const std::string & );
bool Set( const string &set, const string &value );
string Get( const string &get );
bool Save();
void InterpExitStr(string s);
string GenExitStr();
list<Char *> _charList;
private:
RoomMap exits;
map<string, string> info;
bool Load(unsigned int r);
bool LoadVnum(const string& vnum);
};
class EditRoomHandler: public Handler
{
Room * _edit;
public:
EditRoomHandler();
EditRoomHandler( Char *, const std::string & );
void Enter( Char * );
void Exit( Char * );
void Handle( Char *, const std::string & );
std::string Prompt( Char * );
};
#define ROOM_LIMBO "1"
#define MIN_VNUM 100
#define MAX_VNUM 1000000
#define DROOM_START MAX_VNUM+1
#endif