HoverRace
2.0
|
Base class for announcements. More...
#include <Announcement.h>
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::Box > | CreateIcon (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::Player > | GetPlayer () const |
const std::string & | GetPostType () const |
virtual void | OnClick () |
Handle when the announcement is clicked. More... | |
Announcement & | operator= (const Announcement &)=delete |
virtual std::ostream & | StreamOut (std::ostream &os) const |
Private Attributes | |
const std::string | label |
std::shared_ptr< Player::Player > | player |
const std::string | postType |
Base class for announcements.
|
inline |
Constructor.
postType | The type of announcement, used for debugging. |
label | The user-visible label. |
player | The optional target player this announcement is aimed at. |
|
inlinevirtual |
|
pure virtual |
Fill in the UI contents of the announcement.
display | The display the announcement will appear on. |
grid | The grid (initially empty) to which components should be added. |
Implemented in HoverRace::Client::MessageAnnouncement.
|
pure virtual |
Create the optional icon to display next to the announcement.
display | The display the announcement will appear on. |
parent | The container the icon will be added to. |
nullptr
). Implemented in HoverRace::Client::PlayerStatusAnnouncement, and HoverRace::Client::MessageAnnouncement.
|
inline |
|
inline |
|
inline |
|
inlinevirtual |
Handle when the announcement is clicked.
|
delete |
|
inlinevirtual |
|
private |
|
private |
|
private |