Shkyera Engine
Easy to use, game engine for Python
shkyera::ConsoleWidget Class Reference

A user interface widget for the console, used for logging and displaying messages. More...

#include <ConsoleWidget.hpp>

Inheritance diagram for shkyera::ConsoleWidget:
[legend]

Public Member Functions

virtual void draw () override
 Implementation of the abstract draw method to render the console widget. More...
 
 Widget (std::string name)
 Constructor to create a widget with a specified name. More...
 
- Public Member Functions inherited from shkyera::Widget
 Widget (std::string name)
 Constructor to create a widget with a specified name. More...
 

Static Public Member Functions

static void clear ()
 Clear all logs from the console widget. More...
 
static void enableVerbose ()
 Enable verbose logging mode. More...
 
static void disableVerbose ()
 Disable verbose logging mode. More...
 
static void logVerbose (std::string text)
 Log a verbose message to the console. More...
 
static void logInfo (std::string text)
 Log an informational message to the console. More...
 
static void logSuccess (std::string text)
 Log a success message to the console. More...
 
static void logError (std::string text)
 Log an error message to the console. More...
 

Static Public Attributes

static constexpr size_t MAX_LOGS = 50
 The maximum number of logs to keep in the console. More...
 

Private Member Functions

void drawInfoBar () const
 Draw the information bar of the console widget. More...
 

Static Private Attributes

static size_t _totalVerbose = 0
 The total number of verbose logs. More...
 
static size_t _totalInfo = 0
 The total number of informational logs. More...
 
static size_t _totalSuccess = 0
 The total number of success logs. More...
 
static size_t _totalError = 0
 The total number of error logs. More...
 
static std::vector< std::shared_ptr< Log > > _logs = {}
 A collection of logs in the console. More...
 
static bool _verbose = true
 A flag indicating verbose logging mode. More...
 

Additional Inherited Members

- Public Attributes inherited from shkyera::Widget
std::string _name
 The name of the widget. More...
 

Detailed Description

A user interface widget for the console, used for logging and displaying messages.

Member Function Documentation

◆ clear()

void shkyera::ConsoleWidget::clear ( )
static

Clear all logs from the console widget.

◆ disableVerbose()

void shkyera::ConsoleWidget::disableVerbose ( )
static

Disable verbose logging mode.

◆ draw()

void shkyera::ConsoleWidget::draw ( )
overridevirtual

Implementation of the abstract draw method to render the console widget.

Implements shkyera::Widget.

◆ drawInfoBar()

void shkyera::ConsoleWidget::drawInfoBar ( ) const
private

Draw the information bar of the console widget.

◆ enableVerbose()

void shkyera::ConsoleWidget::enableVerbose ( )
static

Enable verbose logging mode.

◆ logError()

void shkyera::ConsoleWidget::logError ( std::string  text)
static

Log an error message to the console.

Parameters
textThe error message to log.

◆ logInfo()

void shkyera::ConsoleWidget::logInfo ( std::string  text)
static

Log an informational message to the console.

Parameters
textThe informational message to log.

◆ logSuccess()

void shkyera::ConsoleWidget::logSuccess ( std::string  text)
static

Log a success message to the console.

Parameters
textThe success message to log.

◆ logVerbose()

void shkyera::ConsoleWidget::logVerbose ( std::string  text)
static

Log a verbose message to the console.

Parameters
textThe verbose message to log.

◆ Widget()

shkyera::Widget::Widget

Constructor to create a widget with a specified name.

Parameters
nameThe name of the widget.

Member Data Documentation

◆ _logs

std::vector< std::shared_ptr< Log > > shkyera::ConsoleWidget::_logs = {}
staticprivate

A collection of logs in the console.

◆ _totalError

size_t shkyera::ConsoleWidget::_totalError = 0
staticprivate

The total number of error logs.

◆ _totalInfo

size_t shkyera::ConsoleWidget::_totalInfo = 0
staticprivate

The total number of informational logs.

◆ _totalSuccess

size_t shkyera::ConsoleWidget::_totalSuccess = 0
staticprivate

The total number of success logs.

◆ _totalVerbose

size_t shkyera::ConsoleWidget::_totalVerbose = 0
staticprivate

The total number of verbose logs.

◆ _verbose

bool shkyera::ConsoleWidget::_verbose = true
staticprivate

A flag indicating verbose logging mode.

◆ MAX_LOGS

constexpr size_t shkyera::ConsoleWidget::MAX_LOGS = 50
staticconstexpr

The maximum number of logs to keep in the console.


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