duncan
Mom and Dad were wrong!
|
#include <map.h>
Public Member Functions | |
Map (const std::string &) | |
void | reset () |
virtual bool | load (const std::string &) |
bool | is_vacant (size_t, size_t) const |
size_t | width () const |
size_t | height () const |
net::maphash_t | hash () |
Static Public Member Functions | |
static net::maphash_t | hash (const std::string &) |
Protected Member Functions | |
size_t | encode (size_t r, size_t c) const |
char | tile (size_t r, size_t c) const |
Static Protected Member Functions | |
static net::maphash_t | hash (size_t, size_t, const std::vector< char > &) |
Protected Attributes | |
size_t | width_ |
size_t | height_ |
std::vector< char > | map_ |
net::maphash_t | hash_ |
Store information about a map, and draw it in a specified ncurses window.
see LICENSE
Map::Map | ( | const std::string & | str | ) |
Load the map from a file.
str | name of the file |
std::runtime_error | if map cannot be loaded |
size_t map::Map::encode | ( | size_t | r, |
size_t | c | ||
) | const [inline, protected] |
Get the index in map_ of a particular tile.
r | row of tile |
c | column of tile |
net::maphash_t Map::hash | ( | ) |
Get the hash of this map.
net::maphash_t Map::hash | ( | const std::string & | str | ) | [static] |
Get the hash of the a certain map (0 if it doesn't exist).
str | filename of the map |
net::maphash_t Map::hash | ( | size_t | w, |
size_t | h, | ||
const std::vector< char > & | tiles | ||
) | [static, protected] |
Get the hash of a map.
w | width |
h | height |
tiles | map data |
size_t Map::height | ( | ) | const |
Get the height of the map.
bool Map::is_vacant | ( | size_t | r, |
size_t | c | ||
) | const |
r | row |
c | column |
bool Map::load | ( | const std::string & | str | ) | [virtual] |
Load the map from a file.
str | name of the file |
Reimplemented in server::ServerMap.
void Map::reset | ( | ) |
Reset the map.
char map::Map::tile | ( | size_t | r, |
size_t | c | ||
) | const [inline, protected] |
r | row of tile |
c | column of tile |
size_t Map::width | ( | ) | const |
Get the width of the map.