yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::core::Controller Class Reference

Main controller for the application. More...

#include <controller.h>

Collaboration diagram for yaze::core::Controller:

Public Member Functions

bool IsActive () const
 
absl::Status OnEntry (std::string filename="")
 
void OnInput ()
 
absl::Status OnLoad ()
 
void DoRender () const
 
void OnExit ()
 
void SetStartupEditor (const std::string &editor_name, const std::string &cards)
 
auto window () -> SDL_Window *
 
void set_active (bool active)
 
auto active () const
 
auto overworld () -> yaze::zelda3::Overworld *
 
auto GetCurrentRom () -> Rom *
 
auto renderer () -> gfx::IRenderer *
 

Private Member Functions

friend int::main (int argc, char **argv)
 

Private Attributes

bool active_ = false
 
core::Window window_
 
editor::EditorManager editor_manager_
 
std::unique_ptr< gfx::IRendererrenderer_
 

Detailed Description

Main controller for the application.

This class is responsible for managing the main window and the main editor. It is the main entry point for the application.

Definition at line 24 of file controller.h.

Member Function Documentation

◆ IsActive()

bool yaze::core::Controller::IsActive ( ) const
inline

Definition at line 26 of file controller.h.

References active_.

Referenced by yaze::test::RunIntegrationTest(), and yaze::test::EditorIntegrationTest::RunTest().

◆ OnEntry()

◆ OnInput()

void yaze::core::Controller::OnInput ( )

Definition at line 53 of file controller.cc.

References yaze::core::HandleEvents(), PRINT_IF_ERROR, and window_.

Referenced by yaze::test::RunIntegrationTest(), and yaze::test::EditorIntegrationTest::RunTest().

Here is the call graph for this function:

◆ OnLoad()

◆ DoRender()

void yaze::core::Controller::DoRender ( ) const

◆ OnExit()

void yaze::core::Controller::OnExit ( )

Definition at line 123 of file controller.cc.

References PRINT_IF_ERROR, renderer_, yaze::core::ShutdownWindow(), and window_.

Referenced by main(), and yaze::test::RunIntegrationTest().

Here is the call graph for this function:

◆ SetStartupEditor()

void yaze::core::Controller::SetStartupEditor ( const std::string &  editor_name,
const std::string &  cards 
)

Definition at line 44 of file controller.cc.

References editor_manager_, and yaze::editor::EditorManager::OpenEditorAndCardsFromFlags().

Here is the call graph for this function:

◆ window()

auto yaze::core::Controller::window ( ) -> SDL_Window*
inline

◆ set_active()

void yaze::core::Controller::set_active ( bool  active)
inline

Definition at line 37 of file controller.h.

References active(), and active_.

Referenced by yaze::test::EditorIntegrationTest::Initialize(), and yaze::test::RunIntegrationTest().

Here is the call graph for this function:

◆ active()

auto yaze::core::Controller::active ( ) const
inline

Definition at line 38 of file controller.h.

References active_.

Referenced by set_active().

◆ overworld()

auto yaze::core::Controller::overworld ( ) -> yaze::zelda3::Overworld*
inline

Definition at line 39 of file controller.h.

References editor_manager_, and yaze::editor::EditorManager::overworld().

Referenced by E2ETest_CanvasSelectionTest().

Here is the call graph for this function:

◆ GetCurrentRom()

auto yaze::core::Controller::GetCurrentRom ( ) -> Rom*
inline

Definition at line 42 of file controller.h.

References editor_manager_, and yaze::editor::EditorManager::GetCurrentRom().

Here is the call graph for this function:

◆ renderer()

auto yaze::core::Controller::renderer ( ) -> gfx::IRenderer*
inline

Definition at line 43 of file controller.h.

References renderer_.

◆ int::main()

yaze::core::Controller::int::main ( int  argc,
char **  argv 
)
private

Member Data Documentation

◆ active_

bool yaze::core::Controller::active_ = false
private

Definition at line 48 of file controller.h.

Referenced by active(), IsActive(), OnEntry(), OnLoad(), and set_active().

◆ window_

core::Window yaze::core::Controller::window_
private

Definition at line 49 of file controller.h.

Referenced by OnEntry(), OnExit(), OnInput(), OnLoad(), and window().

◆ editor_manager_

editor::EditorManager yaze::core::Controller::editor_manager_
private

Definition at line 50 of file controller.h.

Referenced by GetCurrentRom(), OnEntry(), OnLoad(), overworld(), and SetStartupEditor().

◆ renderer_

std::unique_ptr<gfx::IRenderer> yaze::core::Controller::renderer_
private

Definition at line 51 of file controller.h.

Referenced by DoRender(), OnEntry(), OnExit(), and renderer().


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