-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Implemented logic to get current scene node instance. * Added functionality to get instances from collisions. * Added queue_deletion method for Node for the Python API.
- Loading branch information
Showing
19 changed files
with
290 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from roll.node import Node2D | ||
|
||
class Test(Node2D): | ||
def _start(self) -> None: | ||
print("Test created!") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#ifndef NODE_COMPONENT_H | ||
#define NODE_COMPONENT_H | ||
|
||
#include <string> | ||
#include <vector> | ||
|
||
#include "../component.h" | ||
|
||
using NodeType = std::uint32_t; | ||
|
||
enum _NodeType { | ||
NodeType_INVALID = 0, | ||
NodeType_NODE = 1, | ||
NodeType_NODE2D = 2, | ||
}; | ||
|
||
struct NodeComponent { | ||
NodeType type; | ||
std::string name; | ||
std::vector<std::string> tags; | ||
}; | ||
|
||
#endif //NODE_COMPONENT_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#include "node_type_helper.h" | ||
|
||
const std::string NodeTypeHelper::NODE_TYPE_INVALID = "Invalid"; | ||
const std::string NodeTypeHelper::NODE_TYPE_NODE = "Node"; | ||
const std::string NodeTypeHelper::NODE_TYPE_NODE2D = "Node2D"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#ifndef NODE_TYPE_HELPER_H | ||
#define NODE_TYPE_HELPER_H | ||
|
||
#include "component/components/node_component.h" | ||
|
||
class NodeTypeHelper { | ||
private: | ||
static const std::string NODE_TYPE_INVALID; | ||
static const std::string NODE_TYPE_NODE; | ||
static const std::string NODE_TYPE_NODE2D; | ||
public: | ||
static std::string GetNodeTypeString(NodeType nodeType) { | ||
switch (nodeType) { | ||
case NodeType_NODE: | ||
return NODE_TYPE_NODE; | ||
case NodeType_NODE2D: | ||
return NODE_TYPE_NODE2D; | ||
default: | ||
return NODE_TYPE_INVALID; | ||
} | ||
} | ||
static NodeType GetNodeTypeInt(const std::string &nodeTypeString) { | ||
if (nodeTypeString == NODE_TYPE_NODE) { | ||
return NodeType_NODE; | ||
} else if(nodeTypeString == NODE_TYPE_NODE2D) { | ||
return NodeType_NODE2D; | ||
} | ||
return NodeType_INVALID; | ||
} | ||
}; | ||
|
||
#endif //NODE_TYPE_HELPER_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#ifndef SCENE_CONTEXT_H | ||
#define SCENE_CONTEXT_H | ||
|
||
#include "../ecs/entity/entity.h" | ||
|
||
class SceneContext { | ||
public: | ||
Entity currentSceneEntity; | ||
|
||
SceneContext() = default; | ||
}; | ||
|
||
#endif //SCENE_CONTEXT_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.