duncan
Mom and Dad were wrong!
Public Member Functions
client::World Class Reference

#include <world.h>

Collaboration diagram for client::World:
Collaboration graph
[legend]

List of all members.

Public Member Functions

bool load (const std::string &)
void reset ()
void reset_visible ()
void add_visible (net::index_t)
void set_char_pos (net::index_t, size_t, size_t)
void add_char (net::index_t, const std::string &)
void remove_char (net::index_t)
void set_char_name (net::index_t, const std::string &)
void set_follow (net::index_t)
const std::string & char_name (net::index_t)
void draw (NCWindow &)
bool is_vacant (size_t, size_t, net::index_t)
size_t width ()
size_t height ()

Detailed Description

Store the client's information about the world.

Author:
Harry Slatyer

see LICENSE


Member Function Documentation

void World::add_char ( net::index_t  ch,
const std::string &  name 
)

Add a new character.

Parameters:
chindex of the character
namename of the character
void World::add_visible ( net::index_t  ch)

Add a character to the list of visible characters.

Parameters:
chindex of character
const std::string & World::char_name ( net::index_t  ch)

Get the name of a character.

Parameters:
chindex of character
Returns:
name of character
void World::draw ( NCWindow wnd)

Draw the world.

Parameters:
wndwindow in which to draw the world
size_t World::height ( )

Get the height of the map.

Returns:
height of map
bool World::is_vacant ( size_t  r,
size_t  c,
net::index_t  igind 
)
Returns:
true iff the tile at the specified ccordinate is not occupied by anything that would prevent a player from moving there (namely a solid map tile or a visible character).
Parameters:
rrow of tile
ccolumn of tile
igindindex of character to ignore
bool World::load ( const std::string &  str)

Load the map.

Parameters:
strfilename of map
void World::remove_char ( net::index_t  ch)

Remove a character.

Parameters:
chindex of character
void World::reset ( )

Reset the world.

void World::reset_visible ( )

Reset the list of visible characters.

void World::set_char_pos ( net::index_t  ch,
size_t  r,
size_t  c 
)

Set the position of a character.

Parameters:
chindex of character
rrow
ccolumn
void World::set_follow ( net::index_t  ch)

Set the world view to center on a particular character.

Parameters:
chthe character on whom to center the view
size_t World::width ( )

Get the width of the map.

Returns:
width of map

The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations