TimeFormatterComponent.ixx File
Component that formats time values for UI display. More...
Included Headers
#include <format>
#include <string>
#include <helios.engine.modules.ui.layout.types.TimeDisplayMode>
Namespaces Index
| namespace | helios |
| namespace | engine |
|
Main engine module aggregating core infrastructure and game systems. More... | |
| namespace | modules |
|
Domain-specific components and systems. More... | |
| namespace | ui |
|
User interface components and systems for game entities. More... | |
| namespace | layout |
|
Layout primitives for UI positioning and value formatting. More... | |
| namespace | components |
|
Layout-related UI components. More... | |
Classes Index
| class | TimeFormatterComponent |
|
Component that formats elapsed or remaining time into a display string. More... | |
Description
Component that formats time values for UI display.
File Listing
The file content with the documentation metadata removed is:
14using namespace helios::engine::modules::ui::layout::types;
16export namespace helios::engine::modules::ui::layout::components {
27 class TimeFormatterComponent {
55 mutable TimeDisplayMode displayMode_ = TimeDisplayMode::Elapsed;
66 void setFormat(std::string format, const TimeDisplayMode displayMode = TimeDisplayMode::Elapsed) {
67 format_ = std::move(format);
83 const auto effectiveDisplayMode = duration == 0 ? TimeDisplayMode::Elapsed : displayMode_;
87 case TimeDisplayMode::Elapsed: {
93 case TimeDisplayMode::Remaining: {
124 void setElapsedLabel(std::string label) {
134 std::string elapsedLabel() {
143 bool hasElapsedLabel() const {
152 void setHideWhenZero(const bool hideWhenZero) noexcept {
153 hideWhenZero_ = hideWhenZero;
161 bool hideWhenZero() const {
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.