Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
Olympe::NodeGraphManager Class Reference

NodeGraphManager - Manages multiple node graphs Allows opening multiple behavior trees/FSMs simultaneously. More...

#include <NodeGraphManager.h>

Public Member Functions

void Initialize ()
 
void Shutdown ()
 
int CreateGraph (const std::string &name, const std::string &type)
 
bool CloseGraph (int graphId)
 
NodeGraphGetGraph (int graphId)
 
const NodeGraphGetGraph (int graphId) const
 
void SetActiveGraph (int graphId)
 
int GetActiveGraphId () const
 
NodeGraphGetActiveGraph ()
 
const NodeGraphGetActiveGraph () const
 
std::vector< intGetAllGraphIds () const
 
std::string GetGraphName (int graphId) const
 
void SetGraphOrder (const std::vector< int > &newOrder)
 
bool SaveGraph (int graphId, const std::string &filepath)
 
int LoadGraph (const std::string &filepath)
 
bool IsInitialized () const
 
bool IsGraphDirty (int graphId) const
 
bool HasUnsavedChanges () const
 

Static Public Member Functions

static NodeGraphManagerInstance ()
 
static NodeGraphManagerGet ()
 

Private Member Functions

 NodeGraphManager ()
 
 ~NodeGraphManager ()
 
 NodeGraphManager (const NodeGraphManager &)=delete
 
NodeGraphManageroperator= (const NodeGraphManager &)=delete
 

Private Attributes

bool m_Initialized = false
 
int m_ActiveGraphId = -1
 
int m_LastActiveGraphId = -1
 
int m_NextGraphId = 1
 
std::map< int, std::unique_ptr< NodeGraph > > m_Graphs
 
std::vector< intm_GraphOrder
 

Detailed Description

NodeGraphManager - Manages multiple node graphs Allows opening multiple behavior trees/FSMs simultaneously.

Definition at line 190 of file NodeGraphManager.h.

Constructor & Destructor Documentation

◆ NodeGraphManager() [1/2]

Olympe::NodeGraphManager::NodeGraphManager ( )
private

Definition at line 555 of file NodeGraphManager.cpp.

◆ ~NodeGraphManager()

Olympe::NodeGraphManager::~NodeGraphManager ( )
private

Definition at line 559 of file NodeGraphManager.cpp.

References Shutdown().

+ Here is the call graph for this function:

◆ NodeGraphManager() [2/2]

Olympe::NodeGraphManager::NodeGraphManager ( const NodeGraphManager )
privatedelete

Member Function Documentation

◆ CloseGraph()

bool Olympe::NodeGraphManager::CloseGraph ( int  graphId)

Definition at line 600 of file NodeGraphManager.cpp.

References GetComponentTypeID_Static(), m_ActiveGraphId, m_GraphOrder, m_Graphs, and m_LastActiveGraphId.

Referenced by Olympe::NodeGraphPanel::RenderGraphTabs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CreateGraph()

int Olympe::NodeGraphManager::CreateGraph ( const std::string &  name,
const std::string &  type 
)

Definition at line 584 of file NodeGraphManager.cpp.

References GetComponentTypeID_Static(), m_ActiveGraphId, m_GraphOrder, m_Graphs, m_LastActiveGraphId, and m_NextGraphId.

Referenced by Olympe::NodeGraphPanel::Render(), and Olympe::NodeGraphPanel::RenderGraphTabs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Get()

static NodeGraphManager & Olympe::NodeGraphManager::Get ( )
inlinestatic

◆ GetActiveGraph() [1/2]

NodeGraph * Olympe::NodeGraphManager::GetActiveGraph ( )

◆ GetActiveGraph() [2/2]

const NodeGraph * Olympe::NodeGraphManager::GetActiveGraph ( ) const

Definition at line 682 of file NodeGraphManager.cpp.

References GetGraph(), and m_ActiveGraphId.

+ Here is the call graph for this function:

◆ GetActiveGraphId()

int Olympe::NodeGraphManager::GetActiveGraphId ( ) const
inline

Definition at line 208 of file NodeGraphManager.h.

References m_ActiveGraphId.

Referenced by Olympe::NodeGraphPanel::Render(), Olympe::NodeGraphPanel::RenderGraph(), and Olympe::NodeGraphPanel::RenderGraphTabs().

+ Here is the caller graph for this function:

◆ GetAllGraphIds()

std::vector< int > Olympe::NodeGraphManager::GetAllGraphIds ( ) const

Definition at line 687 of file NodeGraphManager.cpp.

References m_GraphOrder.

Referenced by Olympe::NodeGraphPanel::RenderGraphTabs().

+ Here is the caller graph for this function:

◆ GetGraph() [1/2]

NodeGraph * Olympe::NodeGraphManager::GetGraph ( int  graphId)

◆ GetGraph() [2/2]

const NodeGraph * Olympe::NodeGraphManager::GetGraph ( int  graphId) const

Definition at line 660 of file NodeGraphManager.cpp.

References GetComponentTypeID_Static(), and m_Graphs.

+ Here is the call graph for this function:

◆ GetGraphName()

std::string Olympe::NodeGraphManager::GetGraphName ( int  graphId) const

Definition at line 693 of file NodeGraphManager.cpp.

References GetComponentTypeID_Static(), and GetGraph().

Referenced by Olympe::NodeGraphPanel::RenderGraphTabs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HasUnsavedChanges()

bool Olympe::NodeGraphManager::HasUnsavedChanges ( ) const

Definition at line 940 of file NodeGraphManager.cpp.

References GetComponentTypeID_Static(), and m_Graphs.

+ Here is the call graph for this function:

◆ Initialize()

void Olympe::NodeGraphManager::Initialize ( )

Definition at line 564 of file NodeGraphManager.cpp.

References m_Initialized.

Referenced by Olympe::BlueprintEditor::Initialize().

+ Here is the caller graph for this function:

◆ Instance()

NodeGraphManager & Olympe::NodeGraphManager::Instance ( )
static

Definition at line 549 of file NodeGraphManager.cpp.

References GetComponentTypeID_Static().

Referenced by Get().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsGraphDirty()

bool Olympe::NodeGraphManager::IsGraphDirty ( int  graphId) const

Definition at line 934 of file NodeGraphManager.cpp.

References GetComponentTypeID_Static(), and GetGraph().

+ Here is the call graph for this function:

◆ IsInitialized()

bool Olympe::NodeGraphManager::IsInitialized ( ) const
inline

Definition at line 222 of file NodeGraphManager.h.

References m_Initialized.

◆ LoadGraph()

int Olympe::NodeGraphManager::LoadGraph ( const std::string &  filepath)

Definition at line 757 of file NodeGraphManager.cpp.

References Olympe::NodeGraph::FromJson(), GetComponentTypeID_Static(), m_ActiveGraphId, m_GraphOrder, m_Graphs, m_LastActiveGraphId, and m_NextGraphId.

Referenced by Olympe::BlueprintEditor::OpenGraphInEditor().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator=()

NodeGraphManager & Olympe::NodeGraphManager::operator= ( const NodeGraphManager )
privatedelete

◆ SaveGraph()

bool Olympe::NodeGraphManager::SaveGraph ( int  graphId,
const std::string &  filepath 
)

Definition at line 716 of file NodeGraphManager.cpp.

References GetComponentTypeID_Static(), and GetGraph().

+ Here is the call graph for this function:

◆ SetActiveGraph()

void Olympe::NodeGraphManager::SetActiveGraph ( int  graphId)

Definition at line 668 of file NodeGraphManager.cpp.

References m_ActiveGraphId, m_Graphs, and m_LastActiveGraphId.

Referenced by Olympe::NodeGraphPanel::RenderGraphTabs().

+ Here is the caller graph for this function:

◆ SetGraphOrder()

void Olympe::NodeGraphManager::SetGraphOrder ( const std::vector< int > &  newOrder)

Definition at line 699 of file NodeGraphManager.cpp.

References GetComponentTypeID_Static(), m_GraphOrder, and m_Graphs.

+ Here is the call graph for this function:

◆ Shutdown()

void Olympe::NodeGraphManager::Shutdown ( )

Definition at line 573 of file NodeGraphManager.cpp.

References m_ActiveGraphId, m_Graphs, and m_Initialized.

Referenced by Olympe::BlueprintEditor::Shutdown(), and ~NodeGraphManager().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_ActiveGraphId

int Olympe::NodeGraphManager::m_ActiveGraphId = -1
private

◆ m_GraphOrder

std::vector<int> Olympe::NodeGraphManager::m_GraphOrder
private

Definition at line 241 of file NodeGraphManager.h.

Referenced by CloseGraph(), CreateGraph(), GetAllGraphIds(), LoadGraph(), and SetGraphOrder().

◆ m_Graphs

std::map<int, std::unique_ptr<NodeGraph> > Olympe::NodeGraphManager::m_Graphs
private

◆ m_Initialized

bool Olympe::NodeGraphManager::m_Initialized = false
private

Definition at line 236 of file NodeGraphManager.h.

Referenced by Initialize(), IsInitialized(), and Shutdown().

◆ m_LastActiveGraphId

int Olympe::NodeGraphManager::m_LastActiveGraphId = -1
private

Definition at line 238 of file NodeGraphManager.h.

Referenced by CloseGraph(), CreateGraph(), LoadGraph(), and SetActiveGraph().

◆ m_NextGraphId

int Olympe::NodeGraphManager::m_NextGraphId = 1
private

Definition at line 239 of file NodeGraphManager.h.

Referenced by CreateGraph(), and LoadGraph().


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