Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
CreateNodeCommand.cpp
Go to the documentation of this file.
1/**
2 * @file CreateNodeCommand.cpp
3 * @brief Implementation of CreateNodeCommand
4 * @author Olympe Engine
5 * @date 2026-02-18
6 */
7
8#include "CreateNodeCommand.h"
9
10namespace Olympe {
11namespace NodeGraph {
12
13CreateNodeCommand::CreateNodeCommand(GraphDocument* graph, const std::string& nodeType, Vector2 position)
14 : m_graph(graph)
15 , m_nodeType(nodeType)
16 , m_position(position)
17{
18}
19
21{
22 if (m_graph != nullptr)
23 {
25 }
26}
27
29{
30 if (m_graph != nullptr && m_createdNodeId.value != 0)
31 {
33 }
34}
35
37{
38 return "Create " + m_nodeType;
39}
40
41} // namespace NodeGraph
42} // namespace Olympe
Command for creating a node.
ComponentTypeID GetComponentTypeID_Static()
Definition ECS_Entity.h:56
void Undo() override
Undo the command.
std::string GetDescription() const override
Get description of the command.
void Execute() override
Execute the command.
CreateNodeCommand(GraphDocument *graph, const std::string &nodeType, Vector2 position)
Main document class for a node graph.
bool DeleteNode(NodeId id)
Delete a node from the graph.
NodeId CreateNode(const std::string &nodeType, Vector2 pos)
Create a new node in the graph.
< Provides AssetID and INVALID_ASSET_ID