Public Types | Public Member Functions | Private Attributes

wesnothd::player Class Reference

#include <player.hpp>

Collaboration diagram for wesnothd::player:
Collaboration graph
[legend]

List of all members.

Public Types

enum  STATUS { LOBBY, PLAYING, OBSERVING }

Public Member Functions

 player (const std::string &n, simple_wml::node &cfg, bool registered, const size_t max_messages=4, const size_t time_period=10, const bool sp=false, const bool moderator=false)
void set_status (STATUS status)
void mark_available (const int game_id=0, const std::string &location="")
void mark_registered (bool registered=true)
bool registered () const
const std::string & name () const
bool selective_ping () const
const simple_wml::nodeconfig_address () const
bool is_message_flooding ()
bool in_game () const
const gameget_game () const
void set_game (game *g)
void set_moderator (bool moderator)
bool is_moderator () const

Private Attributes

const std::string name_
simple_wml::nodecfg_
const bool selective_ping_
bool registered_
time_t flood_start_
unsigned int messages_since_flood_start_
const size_t MaxMessages
const time_t TimePeriod
STATUS status_
bool moderator_

Detailed Description

Definition at line 29 of file player.hpp.


Member Enumeration Documentation

Enumerator:
LOBBY 
PLAYING 
OBSERVING 

Definition at line 32 of file player.hpp.


Constructor & Destructor Documentation

wesnothd::player::player ( const std::string &  n,
simple_wml::node cfg,
bool  registered,
const size_t  max_messages = 4,
const size_t  time_period = 10,
const bool  sp = false,
const bool  moderator = false 
)

Definition at line 22 of file player.cpp.

References cfg_, mark_available(), simple_wml::node::set_attr(), and simple_wml::node::set_attr_dup().

Here is the call graph for this function:


Member Function Documentation

const simple_wml::node* wesnothd::player::config_address (  )  const [inline]

Definition at line 55 of file player.hpp.

References cfg_.

const game* wesnothd::player::get_game (  )  const
Returns:
a pointer to the game the player is in, or NULL if he/she is not in a game at the moment

Referenced by in_game().

Here is the caller graph for this function:

bool wesnothd::player::in_game (  )  const [inline]
Returns:
true iff the player is in a game

Definition at line 62 of file player.hpp.

References get_game().

Here is the call graph for this function:

bool wesnothd::player::is_message_flooding (  ) 

Definition at line 82 of file player.cpp.

References flood_start_, MaxMessages, messages_since_flood_start_, and TimePeriod.

bool wesnothd::player::is_moderator (  )  const [inline]

Definition at line 73 of file player.hpp.

References moderator_.

void wesnothd::player::mark_available ( const int  game_id = 0,
const std::string &  location = "" 
)

Definition at line 63 of file player.cpp.

References cfg_, LOBBY, simple_wml::node::set_attr(), simple_wml::node::set_attr_dup(), and set_status().

Referenced by player().

Here is the call graph for this function:

Here is the caller graph for this function:

void wesnothd::player::mark_registered ( bool  registered = true  ) 

Definition at line 76 of file player.cpp.

References cfg_, registered_, and simple_wml::node::set_attr().

Here is the call graph for this function:

const std::string& wesnothd::player::name (  )  const [inline]

Definition at line 52 of file player.hpp.

References name_.

bool wesnothd::player::registered (  )  const [inline]

Definition at line 49 of file player.hpp.

References registered_.

bool wesnothd::player::selective_ping (  )  const [inline]

Definition at line 53 of file player.hpp.

References selective_ping_.

void wesnothd::player::set_game ( game g  ) 
void wesnothd::player::set_moderator ( bool  moderator  )  [inline]

Definition at line 72 of file player.hpp.

References moderator_.

void wesnothd::player::set_status ( STATUS  status  ) 

Definition at line 43 of file player.cpp.

References cfg_, LOBBY, OBSERVING, PLAYING, simple_wml::node::set_attr(), and status_.

Referenced by mark_available().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 77 of file player.hpp.

Referenced by config_address(), mark_available(), mark_registered(), player(), and set_status().

Definition at line 82 of file player.hpp.

Referenced by is_message_flooding().

const size_t wesnothd::player::MaxMessages [private]

Definition at line 84 of file player.hpp.

Referenced by is_message_flooding().

Definition at line 83 of file player.hpp.

Referenced by is_message_flooding().

Definition at line 87 of file player.hpp.

Referenced by is_moderator(), and set_moderator().

const std::string wesnothd::player::name_ [private]

Definition at line 76 of file player.hpp.

Referenced by name().

Definition at line 80 of file player.hpp.

Referenced by mark_registered(), and registered().

const bool wesnothd::player::selective_ping_ [private]

Definition at line 78 of file player.hpp.

Referenced by selective_ping().

Definition at line 86 of file player.hpp.

Referenced by set_status().

const time_t wesnothd::player::TimePeriod [private]

Definition at line 85 of file player.hpp.

Referenced by is_message_flooding().


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

Generated by doxygen 1.7.1 on Thu May 24 2012 01:26:59 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs