Player12
An open source football management simulator
Loading...
Searching...
No Matches
RuntimeEditorDialog Class Reference

#include <runtime_editor_dialog.h>

Classes

struct  Field
 
struct  PopupState
 

Public Types

enum class  Request { None , Apply , Undo }
 

Public Member Functions

 RuntimeEditorDialog (GameController &owner)
 
 ~RuntimeEditorDialog ()
 
 RuntimeEditorDialog (const RuntimeEditorDialog &)=delete
 
RuntimeEditorDialog & operator= (const RuntimeEditorDialog &)=delete
 
 RuntimeEditorDialog (RuntimeEditorDialog &&)=delete
 
RuntimeEditorDialog & operator= (RuntimeEditorDialog &&)=delete
 
void open (const std::optional< NavEntry > &context)
 
void open (const EditorContext &context)
 
void render ()
 
bool isOpen () const
 
Request takeRequest ()
 
const std::vector< RuntimeEditor::Change > & changes () const
 
std::shared_ptr< GameController::EditorSession > session () const
 
void finish (bool success, std::string message)
 

Private Member Functions

void refresh ()
 
void chooseTable (const std::string &name)
 
void selectRow (std::size_t index)
 
void stage ()
 
void renderForm ()
 
void renderSection (std::string_view section, const std::vector< EditorField > &descriptors)
 
void renderNavigation ()
 
void renderBody (float footer)
 
void renderActions ()
 
void renderConfirmation ()
 
const EditorField * fieldDescriptor (const std::string &name) const
 
void limitToGameplay ()
 
void renderBrowser ()
 
bool formDirty () const
 
void close ()
 

Static Private Member Functions

static void renderAttributes (Field &field)
 
static void renderField (Field &field, const EditorField &descriptor)
 
static void renderNumber (Field &field, const EditorField &descriptor)
 
static void renderChoice (Field &field, const EditorField &descriptor)
 

Private Attributes

GameController & controller
 
std::shared_ptr< GameController::EditorSession > editor_session
 
std::vector< RuntimeEditor::Table > tables
 
RuntimeEditor::Page page
 
std::string selected_table
 
PlayerID context_player = 0
 
TeamID context_team = 0
 
std::map< std::string, RuntimeEditor::Value, std::less<> > context_filter
 
std::map< std::string, std::map< std::string, RuntimeEditor::Value, std::less<> >, std::less<> > scoped_filters
 
std::array< char, 128 > search {}
 
int offset = 0
 
std::optional< RuntimeEditor::Row > original
 
std::vector< Field > fields
 
std::map< std::string, std::vector< EditorField >, std::less<> > presentations
 
bool show_records = false
 
std::string focus_label
 
PopupState popup
 
std::string error
 
Request request = Request::None
 
std::vector< RuntimeEditor::Change > pending_changes
 

Friends

class GameFlowTest_GUIFlowLifecycle_Test
 

Detailed Description

Contextual gameplay editor with feature-owned presentation. Owns a draft; apply requests are consumed by GUIView at the next frame boundary.

Member Enumeration Documentation

◆ Request

enum class RuntimeEditorDialog::Request
strong
Enumerator
None 
Apply 
Undo 

Constructor & Destructor Documentation

◆ RuntimeEditorDialog() [1/3]

RuntimeEditorDialog::RuntimeEditorDialog ( GameController &  owner)
explicit

◆ ~RuntimeEditorDialog()

RuntimeEditorDialog::~RuntimeEditorDialog ( )

◆ RuntimeEditorDialog() [2/3]

RuntimeEditorDialog::RuntimeEditorDialog ( const RuntimeEditorDialog &  )
delete

◆ RuntimeEditorDialog() [3/3]

RuntimeEditorDialog::RuntimeEditorDialog ( RuntimeEditorDialog &&  )
delete

Member Function Documentation

◆ changes()

const std::vector< RuntimeEditor::Change > & RuntimeEditorDialog::changes ( ) const
inline

◆ chooseTable()

void RuntimeEditorDialog::chooseTable ( const std::string &  name)
private

◆ close()

void RuntimeEditorDialog::close ( )
private

◆ fieldDescriptor()

const EditorField * RuntimeEditorDialog::fieldDescriptor ( const std::string &  name) const
private

◆ finish()

void RuntimeEditorDialog::finish ( bool  success,
std::string  message 
)

◆ formDirty()

bool RuntimeEditorDialog::formDirty ( ) const
private

◆ isOpen()

bool RuntimeEditorDialog::isOpen ( ) const
inline

◆ limitToGameplay()

void RuntimeEditorDialog::limitToGameplay ( )
private

◆ open() [1/2]

void RuntimeEditorDialog::open ( const EditorContext &  context)

◆ open() [2/2]

void RuntimeEditorDialog::open ( const std::optional< NavEntry > &  context)

◆ operator=() [1/2]

RuntimeEditorDialog & RuntimeEditorDialog::operator= ( const RuntimeEditorDialog &  )
delete

◆ operator=() [2/2]

RuntimeEditorDialog & RuntimeEditorDialog::operator= ( RuntimeEditorDialog &&  )
delete

◆ refresh()

void RuntimeEditorDialog::refresh ( )
private

◆ render()

void RuntimeEditorDialog::render ( )

◆ renderActions()

void RuntimeEditorDialog::renderActions ( )
private

◆ renderAttributes()

void RuntimeEditorDialog::renderAttributes ( Field &  field)
staticprivate

◆ renderBody()

void RuntimeEditorDialog::renderBody ( float  footer)
private

◆ renderBrowser()

void RuntimeEditorDialog::renderBrowser ( )
private

◆ renderChoice()

void RuntimeEditorDialog::renderChoice ( Field &  field,
const EditorField &  descriptor 
)
staticprivate

◆ renderConfirmation()

void RuntimeEditorDialog::renderConfirmation ( )
private

◆ renderField()

void RuntimeEditorDialog::renderField ( Field &  field,
const EditorField &  descriptor 
)
staticprivate

◆ renderForm()

void RuntimeEditorDialog::renderForm ( )
private

◆ renderNavigation()

void RuntimeEditorDialog::renderNavigation ( )
private

◆ renderNumber()

void RuntimeEditorDialog::renderNumber ( Field &  field,
const EditorField &  descriptor 
)
staticprivate

◆ renderSection()

void RuntimeEditorDialog::renderSection ( std::string_view  section,
const std::vector< EditorField > &  descriptors 
)
private

◆ selectRow()

void RuntimeEditorDialog::selectRow ( std::size_t  index)
private

◆ session()

std::shared_ptr< GameController::EditorSession > RuntimeEditorDialog::session ( ) const
inline

◆ stage()

void RuntimeEditorDialog::stage ( )
private

◆ takeRequest()

RuntimeEditorDialog::Request RuntimeEditorDialog::takeRequest ( )

Friends And Related Symbol Documentation

◆ GameFlowTest_GUIFlowLifecycle_Test

friend class GameFlowTest_GUIFlowLifecycle_Test
friend

Member Data Documentation

◆ context_filter

std::map<std::string, RuntimeEditor::Value, std::less<> > RuntimeEditorDialog::context_filter
private

◆ context_player

PlayerID RuntimeEditorDialog::context_player = 0
private

◆ context_team

TeamID RuntimeEditorDialog::context_team = 0
private

◆ controller

GameController& RuntimeEditorDialog::controller
private

◆ editor_session

std::shared_ptr<GameController::EditorSession> RuntimeEditorDialog::editor_session
private

◆ error

std::string RuntimeEditorDialog::error
private

◆ fields

std::vector<Field> RuntimeEditorDialog::fields
private

◆ focus_label

std::string RuntimeEditorDialog::focus_label
private

◆ offset

int RuntimeEditorDialog::offset = 0
private

◆ original

std::optional<RuntimeEditor::Row> RuntimeEditorDialog::original
private

◆ page

RuntimeEditor::Page RuntimeEditorDialog::page
private

◆ pending_changes

std::vector<RuntimeEditor::Change> RuntimeEditorDialog::pending_changes
private

◆ popup

PopupState RuntimeEditorDialog::popup
private

◆ presentations

std::map<std::string, std::vector<EditorField>, std::less<> > RuntimeEditorDialog::presentations
private

◆ request

Request RuntimeEditorDialog::request = Request::None
private

◆ scoped_filters

std::map<std::string, std::map<std::string, RuntimeEditor::Value, std::less<> >, std::less<> > RuntimeEditorDialog::scoped_filters
private

◆ search

std::array<char, 128> RuntimeEditorDialog::search {}
private

◆ selected_table

std::string RuntimeEditorDialog::selected_table
private

◆ show_records

bool RuntimeEditorDialog::show_records = false
private

◆ tables

std::vector<RuntimeEditor::Table> RuntimeEditorDialog::tables
private

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