Peoplemon  0.1.0
Peoplemon 3 game source documentation
Classes | Public Types | Public Member Functions | List of all members
editor::component::BehaviorEditor Class Reference

Inline GUI elements with openable window for editing behaviors. More...

#include <BehaviorEditor.hpp>

Public Types

using OnSetCb = std::function< void()>
 
using NotifyWindowCb = std::function< void()>
 

Public Member Functions

 BehaviorEditor (const OnSetCb &cb, const NotifyWindowCb &onOpen, const NotifyWindowCb &onClose)
 Construct a new Behavior Editor. More...
 
const core::file::BehaviorgetValue () const
 Returns the behavior value. More...
 
void pack (bl::gui::Box::Ptr parent)
 Packs the GUI elements for the editor into the given container. More...
 
void configure (bl::gui::GUI *parent, const core::file::Behavior &behavior)
 Sets the parent GUI object and current value. Call before using. More...
 
void hide ()
 Hides the editor window if opened. More...
 

Detailed Description

Inline GUI elements with openable window for editing behaviors.

Definition at line 17 of file BehaviorEditor.hpp.

Member Typedef Documentation

◆ NotifyWindowCb

Definition at line 20 of file BehaviorEditor.hpp.

◆ OnSetCb

using editor::component::BehaviorEditor::OnSetCb = std::function<void()>

Definition at line 19 of file BehaviorEditor.hpp.

Constructor & Destructor Documentation

◆ BehaviorEditor()

editor::component::BehaviorEditor::BehaviorEditor ( const OnSetCb cb,
const NotifyWindowCb onOpen,
const NotifyWindowCb onClose 
)

Construct a new Behavior Editor.

Parameters
cbCallback for when the behavior is modified
onOpenCalled when the window is opened
onCloseCalled when the window is closed

Definition at line 46 of file BehaviorEditor.cpp.

Member Function Documentation

◆ configure()

void editor::component::BehaviorEditor::configure ( bl::gui::GUI *  parent,
const core::file::Behavior behavior 
)

Sets the parent GUI object and current value. Call before using.

Parameters
parentThe parent GUI object
behaviorThe behavior value to init with

Definition at line 160 of file BehaviorEditor.cpp.

◆ getValue()

const core::file::Behavior & editor::component::BehaviorEditor::getValue ( ) const

Returns the behavior value.

Definition at line 196 of file BehaviorEditor.cpp.

◆ hide()

void editor::component::BehaviorEditor::hide ( )

Hides the editor window if opened.

Definition at line 190 of file BehaviorEditor.cpp.

◆ pack()

void editor::component::BehaviorEditor::pack ( bl::gui::Box::Ptr  parent)

Packs the GUI elements for the editor into the given container.

Parameters
parentThe box to pack in

Definition at line 148 of file BehaviorEditor.cpp.


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