14#include "../../Source/third_party/nlohmann/json.hpp"
49 default:
return "Unknown";
144 bool LinkNodes(
int parentId,
int childId);
201 int CreateGraph(
const std::string& name,
const std::string& type);
218 bool SaveGraph(
int graphId,
const std::string& filepath);
219 int LoadGraph(
const std::string& filepath);
240 std::map<int, std::unique_ptr<NodeGraph>>
m_Graphs;
ComponentTypeID GetComponentTypeID_Static()
NodeGraphManager - Manages multiple node graphs Allows opening multiple behavior trees/FSMs simultane...
int GetActiveGraphId() const
bool IsGraphDirty(int graphId) const
NodeGraph * GetActiveGraph()
bool CloseGraph(int graphId)
std::vector< int > GetAllGraphIds() const
void SetGraphOrder(const std::vector< int > &newOrder)
int LoadGraph(const std::string &filepath)
NodeGraphManager(const NodeGraphManager &)=delete
void SetActiveGraph(int graphId)
NodeGraph * GetGraph(int graphId)
std::string GetGraphName(int graphId) const
int CreateGraph(const std::string &name, const std::string &type)
std::vector< int > m_GraphOrder
static NodeGraphManager & Instance()
bool IsInitialized() const
bool HasUnsavedChanges() const
bool SaveGraph(int graphId, const std::string &filepath)
static NodeGraphManager & Get()
std::map< int, std::unique_ptr< NodeGraph > > m_Graphs
NodeGraphManager & operator=(const NodeGraphManager &)=delete
bool UnlinkNodes(int parentId, int childId)
bool DeleteNode(int nodeId)
void CalculateNodePositionsHierarchical()
const std::string & GetFilepath() const
static NodeGraph FromJson(const nlohmann::json &j)
void SetFilepath(const std::string &filepath)
bool LinkNodes(int parentId, int childId)
EditorMetadata editorMetadata
int GetNextNodeId() const
std::vector< GraphLink > GetAllLinks() const
bool SetNodeParameter(int nodeId, const std::string ¶mName, const std::string &value)
nlohmann::json ToJson() const
std::vector< GraphNode * > GetAllNodes()
std::vector< GraphNode > m_Nodes
bool ValidateGraph(std::string &errorMsg) const
int FindNodeIndex(int nodeId) const
GraphNode * GetNode(int nodeId)
std::string GetNodeParameter(int nodeId, const std::string ¶mName) const
int CreateNode(NodeType type, float x, float y, const std::string &name="")
const char * NodeTypeToString(NodeType type)
NodeType StringToNodeType(const std::string &str)
GraphLink(int from, int to)
std::string conditionType
std::string decoratorType
std::map< std::string, std::string > parameters
GraphNode(int nodeId, NodeType nodeType, const std::string &nodeName="")
std::vector< int > childIds