couch/core/Node.h

35 lines
631 B
C
Raw Normal View History

2021-01-14 11:52:01 -06:00
#ifndef NODE_H
#define NODE_H
#include <vector>
2021-01-21 15:26:39 -06:00
#include "types.h"
2021-01-14 11:52:01 -06:00
class Node; // Forwards declare
class NodeList : public std::vector<Node*> {
public:
void Append(Node *node);
2021-01-24 16:37:35 -06:00
private:
bool isPrefabList = true;
friend class Node;
2021-01-14 11:52:01 -06:00
};
class Node {
public:
NodeList children;
static Node *GetRoot();
virtual bool IsDrawable() const;
2021-01-24 16:37:35 -06:00
virtual void Draw() {};
2021-01-14 11:52:01 -06:00
virtual bool IsTransformable() const;
2021-01-21 15:26:39 -06:00
virtual Name GetType() const;
2021-01-24 16:37:35 -06:00
virtual Node* Create();
virtual Node* Instance();
virtual Node* Duplicate();
2021-01-14 11:52:01 -06:00
private:
static Node *root;
2021-01-24 16:37:35 -06:00
bool isPrefab = true;
friend class NodeList;
2021-01-14 11:52:01 -06:00
};
#endif /* NODE_H */