duncan
Mom and Dad were wrong!
Public Types | Public Member Functions | Public Attributes
server::Player Class Reference

#include <player.h>

Inheritance diagram for server::Player:
Inheritance graph
[legend]
Collaboration diagram for server::Player:
Collaboration graph
[legend]

List of all members.

Public Types

typedef std::pair< net::Packet
*, net::Packet * > 
pppair_t
 Packet pointer pair.

Public Member Functions

 Player (net::index_t)
net::Packetnext_packet ()
pppair_t demand_packet ()
void pop_packet (net::Packet *)
net::index_t enet_index ()
virtual bool can_find_path ()

Public Attributes

bool connected
size_t windex
std::string changeworld
double last_pos_send

Detailed Description

Represent a player.

Author:
Harry Slatyer
Malcolm Gill

see LICENSE


Constructor & Destructor Documentation

Player::Player ( net::index_t  ind)

Create a Player with a given enet index.

Parameters:
indenet index

Member Function Documentation

bool Player::can_find_path ( ) [virtual]

Players can be used for pathfinding.

Reimplemented from server::Character.

Player::pppair_t Player::demand_packet ( )

Gets a pointer to a usable Packet. If none is available, allow an already-used Packet to be overwritten; tries to find a non-reliable packet first, but if that fails, then the most recently used packet is reused.

Returns:
(pointer to discarded packet (or null if none), pointer to usable packet)
net::index_t Player::enet_index ( )

Get player's enet index.

Returns:
enet index of player
net::Packet * Player::next_packet ( )

Gets a pointer to a Packet to be filled with data to be sent to this Player.

Returns:
pointer to next available Packet, or nullptr if none is available.
void Player::pop_packet ( net::Packet p)

Marks the specified packet as once again available to be used to send data.


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