9 #include "../clib/cfgelem.h" 10 #include "../clib/cfgfile.h" 11 #include "../clib/strutil.h" 19 const std::string& realm_path )
21 std::string realm_cfg_filename;
22 if ( realm_path ==
"" )
23 realm_cfg_filename =
"realm/" + realm_name +
"/realm.cfg";
25 realm_cfg_filename = realm_path +
"/realm.cfg";
29 if ( !cf.
read( elem ) )
30 elem.
throw_error(
"Unable to read configuration file " + realm_cfg_filename );
37 unsigned short calc_grid_size(
const unsigned size )
43 return static_cast<unsigned short>( grid_size );
51 width( elem.remove_ushort(
"width" ) ),
52 height( elem.remove_ushort(
"height" ) ),
53 uomapid( elem.remove_unsigned(
"uomapid", 0 ) ),
54 uodif( elem.remove_bool(
"uodif", false ) ),
57 season( elem.remove_unsigned(
"season", 1 ) ),
66 size_t size =
sizeof( *this );
74 return "realm/" +
name +
"/" + filename;
static RealmDescriptor Load(const std::string &realm_name, const std::string &realm_path="")
size_t sizeEstimate() const
POL_NORETURN void throw_error(const std::string &errmsg) const
std::string mapserver_type
unsigned short grid_height
std::string path(const std::string &filename) const
std::string strlower(const std::string &str)
const unsigned WGRID_SIZE
unsigned num_static_patches
RealmDescriptor(const std::string &realm_name, const std::string &realm_path, Clib::ConfigElem &elem)
bool read(ConfigElem &elem)
unsigned short grid_width