HoverRace  2.0
Public Member Functions | Private Attributes | List of all members
HoverRace::Client::Announcement Class Referenceabstract

Base class for announcements. More...

#include <Announcement.h>

+ Inheritance diagram for HoverRace::Client::Announcement:

Public Member Functions

 Announcement (const std::string &postType, const std::string &label, std::shared_ptr< Player::Player > player)
 Constructor. More...
 
virtual ~Announcement ()
 
virtual void CreateContents (Display::Display &display, Display::FlexGrid &grid) const =0
 Fill in the UI contents of the announcement. More...
 
virtual std::shared_ptr< Display::BoxCreateIcon (Display::Display &display, Display::Container &parent) const =0
 Create the optional icon to display next to the announcement. More...
 
const std::string & GetLabel () const
 
std::shared_ptr< Player::PlayerGetPlayer () const
 
const std::string & GetPostType () const
 
virtual void OnClick ()
 Handle when the announcement is clicked. More...
 
Announcementoperator= (const Announcement &)=delete
 
virtual std::ostream & StreamOut (std::ostream &os) const
 

Private Attributes

const std::string label
 
std::shared_ptr< Player::Playerplayer
 
const std::string postType
 

Detailed Description

Base class for announcements.

Author
Michael Imamura

Constructor & Destructor Documentation

HoverRace::Client::Announcement::Announcement ( const std::string &  postType,
const std::string &  label,
std::shared_ptr< Player::Player player 
)
inline

Constructor.

Parameters
postTypeThe type of announcement, used for debugging.
labelThe user-visible label.
playerThe optional target player this announcement is aimed at.
virtual HoverRace::Client::Announcement::~Announcement ( )
inlinevirtual

Member Function Documentation

virtual void HoverRace::Client::Announcement::CreateContents ( Display::Display display,
Display::FlexGrid grid 
) const
pure virtual

Fill in the UI contents of the announcement.

Parameters
displayThe display the announcement will appear on.
gridThe grid (initially empty) to which components should be added.

Implemented in HoverRace::Client::MessageAnnouncement.

virtual std::shared_ptr<Display::Box> HoverRace::Client::Announcement::CreateIcon ( Display::Display display,
Display::Container parent 
) const
pure virtual

Create the optional icon to display next to the announcement.

Parameters
displayThe display the announcement will appear on.
parentThe container the icon will be added to.
Returns
The created icon (may be nullptr).

Implemented in HoverRace::Client::PlayerStatusAnnouncement, and HoverRace::Client::MessageAnnouncement.

const std::string& HoverRace::Client::Announcement::GetLabel ( ) const
inline
std::shared_ptr<Player::Player> HoverRace::Client::Announcement::GetPlayer ( ) const
inline
const std::string& HoverRace::Client::Announcement::GetPostType ( ) const
inline
virtual void HoverRace::Client::Announcement::OnClick ( )
inlinevirtual

Handle when the announcement is clicked.

Announcement& HoverRace::Client::Announcement::operator= ( const Announcement )
delete
virtual std::ostream& HoverRace::Client::Announcement::StreamOut ( std::ostream &  os) const
inlinevirtual

Member Data Documentation

const std::string HoverRace::Client::Announcement::label
private
std::shared_ptr<Player::Player> HoverRace::Client::Announcement::player
private
const std::string HoverRace::Client::Announcement::postType
private

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