HoverRace  2.0
Classes | Public Types | Public Member Functions | Private Attributes | List of all members
HoverRace::Client::RoomList Class Reference

Server room list. More...

#include <RoomList.h>

Classes

struct  Banner
 
class  IpAddr
 
struct  Server
 

Public Types

typedef std::vector< Banner * > banners_t
 
typedef std::vector< Server * > rooms_t
 

Public Member Functions

 RoomList ()
 
 ~RoomList ()
 
const banners_tGetBanners () const
 
BannerGetCurrentBanner () const
 
const rooms_tGetRooms () const
 
const ServerGetScoreServer () const
 
const ServerGetSelectedRoom () const
 
bool HasBanners () const
 
void LoadFromStream (std::istream &in)
 
void LoadFromUrl (const std::string &url, std::shared_ptr< Net::CancelFlag > cancelFlag={})
 Load the roomlist from a URL. More...
 
BannerNextBanner ()
 Rotate to the next banner in the banner list. More...
 
BannerPeekNextBanner () const
 
void SetSelectedRoom (size_t index)
 Set the currently-selected room index. More...
 

Private Attributes

banners_t banners
 
BannercurBanner
 
size_t curBannerIdx
 
rooms_t rooms
 
Server scoreServer
 
ServerselectedRoom
 

Detailed Description

Server room list.

Author
Michael Imamura

Member Typedef Documentation

Constructor & Destructor Documentation

RoomList::RoomList ( )
RoomList::~RoomList ( )

Member Function Documentation

const banners_t& HoverRace::Client::RoomList::GetBanners ( ) const
inline
Banner* HoverRace::Client::RoomList::GetCurrentBanner ( ) const
inline
const rooms_t& HoverRace::Client::RoomList::GetRooms ( ) const
inline
const Server& HoverRace::Client::RoomList::GetScoreServer ( ) const
inline
const Server* HoverRace::Client::RoomList::GetSelectedRoom ( ) const
inline
bool HoverRace::Client::RoomList::HasBanners ( ) const
inline
void RoomList::LoadFromStream ( std::istream &  in)
void RoomList::LoadFromUrl ( const std::string &  url,
std::shared_ptr< Net::CancelFlag cancelFlag = {} 
)

Load the roomlist from a URL.

Parameters
urlThe URL.
cancelFlagOptional callback to cancel the transfer.
Exceptions
NetExnAn error occurred during the transfer.
CanceledExnThe transfer was canceled.
RoomList::Banner * RoomList::NextBanner ( )

Rotate to the next banner in the banner list.

Will have no effect if there are no banners.

Returns
The next banner in the list (NULL if banner list is empty).
RoomList::Banner * RoomList::PeekNextBanner ( ) const
void RoomList::SetSelectedRoom ( size_t  index)

Set the currently-selected room index.

If an invalid index is provided, then the currently-selected room is set to NULL.

Parameters
indexThe index.

Member Data Documentation

banners_t HoverRace::Client::RoomList::banners
private
Banner* HoverRace::Client::RoomList::curBanner
private
size_t HoverRace::Client::RoomList::curBannerIdx
private
rooms_t HoverRace::Client::RoomList::rooms
private
Server HoverRace::Client::RoomList::scoreServer
private
Server* HoverRace::Client::RoomList::selectedRoom
private

The documentation for this class was generated from the following files: