MAGE  v0.171.0
Matthias Advanced Game Engine
mage::script::TextConsoleScript Class Reference

#include <text_console_script.hpp>

Inheritance diagram for mage::script::TextConsoleScript:
mage::BehaviorScript mage::Component

Public Member Functions

 TextConsoleScript (U32 nb_rows, U32 nb_columns)
 
 TextConsoleScript (const TextConsoleScript &script)
 
 TextConsoleScript (TextConsoleScript &&script) noexcept
 
virtual ~TextConsoleScript ()
 
TextConsoleScriptoperator= (const TextConsoleScript &script)=delete
 
TextConsoleScriptoperator= (TextConsoleScript &&script)=delete
 
virtual void Load ([[maybe_unused]] Engine &engine) override
 
virtual void Update ([[maybe_unused]] Engine &engine) override
 
void Clear ()
 
void Write (NotNull< const_wzstring > str)
 
void WriteLine (NotNull< const_wzstring > str)
 
void Format (const_wzstring format,...)
 
- Public Member Functions inherited from mage::BehaviorScript
virtual ~BehaviorScript ()
 
BehaviorScriptoperator= (const BehaviorScript &script) noexcept
 
BehaviorScriptoperator= (BehaviorScript &&script) noexcept
 
virtual void FixedUpdate ([[maybe_unused]] Engine &engine)
 
virtual void Close ([[maybe_unused]] Engine &engine)
 
- Public Member Functions inherited from mage::Component
virtual ~Component ()
 
Componentoperator= (const Component &component) noexcept
 
Componentoperator= (Component &&component) noexcept
 
State GetState () const noexcept
 
void SetState (State state) noexcept
 
U64 GetGuid () const noexcept
 
bool HasOwner () const noexcept
 
ProxyPtr< NodeGetOwner () noexcept
 
ProxyPtr< const NodeGetOwner () const noexcept
 

Private Member Functions

void ProcessString (NotNull< const_wzstring > str)
 
void IncrementRow ()
 
void SetCharacter (wchar_t character, U32 row, U32 column)
 

Private Attributes

ProxyPtr< rendering::SpriteTextm_text
 
const U32 m_nb_rows
 
const U32 m_nb_columns
 
U32 m_current_column
 
U32 m_current_row
 
UniquePtr< wchar_t[] > m_buffer
 
std::vector< wchar_t > m_temp_buffer
 
std::mutex m_mutex
 

Additional Inherited Members

- Protected Member Functions inherited from mage::BehaviorScript
 BehaviorScript () noexcept
 
 BehaviorScript (const BehaviorScript &script) noexcept
 
 BehaviorScript (BehaviorScript &&script) noexcept
 
- Protected Member Functions inherited from mage::Component
 Component () noexcept
 
 Component (const Component &component) noexcept
 
 Component (Component &&component) noexcept
 

Constructor & Destructor Documentation

◆ TextConsoleScript() [1/3]

mage::script::TextConsoleScript::TextConsoleScript ( U32  nb_rows,
U32  nb_columns 
)
explicit

◆ TextConsoleScript() [2/3]

mage::script::TextConsoleScript::TextConsoleScript ( const TextConsoleScript script)

◆ TextConsoleScript() [3/3]

mage::script::TextConsoleScript::TextConsoleScript ( TextConsoleScript &&  script)
noexcept

◆ ~TextConsoleScript()

mage::script::TextConsoleScript::~TextConsoleScript ( )
virtualdefault

Member Function Documentation

◆ Clear()

void mage::script::TextConsoleScript::Clear ( )

◆ Format()

void mage::script::TextConsoleScript::Format ( const_wzstring  format,
  ... 
)

◆ IncrementRow()

void mage::script::TextConsoleScript::IncrementRow ( )
private

◆ Load()

void mage::script::TextConsoleScript::Load ( [[maybe_unused] ] Engine engine)
overridevirtual

Loads this behavior script. Allows this behavior script to preform any pre-processing.

Parameters
[in,out]engineA reference to the engine.
Exceptions
ExceptionFailed to load this behavior script.

Reimplemented from mage::BehaviorScript.

◆ operator=() [1/2]

TextConsoleScript& mage::script::TextConsoleScript::operator= ( const TextConsoleScript script)
delete

◆ operator=() [2/2]

TextConsoleScript& mage::script::TextConsoleScript::operator= ( TextConsoleScript &&  script)
delete

◆ ProcessString()

void mage::script::TextConsoleScript::ProcessString ( NotNull< const_wzstring str)
private

◆ SetCharacter()

void mage::script::TextConsoleScript::SetCharacter ( wchar_t  character,
U32  row,
U32  column 
)
private

◆ Update()

void mage::script::TextConsoleScript::Update ( [[maybe_unused] ] Engine engine)
overridevirtual

Updates this behavior script.

This method is called once per frame.

Parameters
[in,out]engineA reference to the engine.
Exceptions
ExceptionFailed to update this behavior script.

Reimplemented from mage::BehaviorScript.

◆ Write()

void mage::script::TextConsoleScript::Write ( NotNull< const_wzstring str)

◆ WriteLine()

void mage::script::TextConsoleScript::WriteLine ( NotNull< const_wzstring str)

Member Data Documentation

◆ m_buffer

UniquePtr< wchar_t[] > mage::script::TextConsoleScript::m_buffer
private

◆ m_current_column

U32 mage::script::TextConsoleScript::m_current_column
private

◆ m_current_row

U32 mage::script::TextConsoleScript::m_current_row
private

◆ m_mutex

std::mutex mage::script::TextConsoleScript::m_mutex
private

◆ m_nb_columns

const U32 mage::script::TextConsoleScript::m_nb_columns
private

◆ m_nb_rows

const U32 mage::script::TextConsoleScript::m_nb_rows
private

◆ m_temp_buffer

std::vector< wchar_t > mage::script::TextConsoleScript::m_temp_buffer
private

◆ m_text

ProxyPtr< rendering::SpriteText > mage::script::TextConsoleScript::m_text
private