6 #include <unordered_map>
23 return this->
id == rhs.id;
29 Credit(
size_t id_) noexcept {
id = id_; }
31 friend class CreditSystem;
86 const std::vector<
Credit>& getCreditsToShowThisFrame() noexcept;
93 getCreditsToNoLongerShowThisFrame() const noexcept {
94 return _creditsToNoLongerShowThisFrame;
98 const std::string INVALID_CREDIT_MESSAGE =
99 "Error: Invalid Credit, cannot get HTML string.";
101 struct HtmlAndLastFrameNumber {
104 int32_t lastFrameNumber;
108 std::vector<HtmlAndLastFrameNumber> _credits;
110 int32_t _currentFrameNumber = 0;
111 std::vector<Credit> _creditsToShowThisFrame;
112 std::vector<Credit> _creditsToNoLongerShowThisFrame;
Creates and manages Credit objects. Avoids repetitions and tracks which credits should be shown and w...
bool shouldBeShownOnScreen(Credit credit) const noexcept
Gets whether or not the credit should be shown on screen.
void startNextFrame() noexcept
Notifies this CreditSystem to start tracking the credits to show for the next frame.
Credit createCredit(std::string &&html, bool showOnScreen=false)
Inserts a credit string.
void addCreditToFrame(Credit credit)
Adds the Credit to the set of credits to show this frame.
void setShowOnScreen(Credit credit, bool showOnScreen) noexcept
Sets whether or not the credit should be shown on screen.
const std::string & getHtml(Credit credit) const noexcept
Get the HTML string for this credit.
Credit createCredit(const std::string &html, bool showOnScreen=false)
Inserts a credit string.
Utility classes for Cesium.
Represents an HTML string that should be shown on screen to attribute third parties for used data,...
bool operator==(const Credit &rhs) const noexcept
Returns true if two credit objects have the same ID.