Game of Ur 0.3.3
This is a computer adaptation of Game of Ur, written in C++ mainly using SDL and OpenGL.
|
The most basic vanilla flavour of scene node comprised of no more than a name and some components. More...
#include <scene_system.hpp>
Static Public Member Functions | |
template<typename ... TComponents> | |
static std::shared_ptr< SceneNode > | create (const Placement &placement, const std::string &name, TComponents...components) |
static std::shared_ptr< SceneNode > | create (const nlohmann::json &sceneNodeDescription) |
static std::shared_ptr< SceneNode > | copy (const std::shared_ptr< const SceneNode > other) |
static std::string | getResourceTypeName () |
![]() | |
static void | SceneNodeCore_del_ (SceneNodeCore *sceneNode) |
Deleter for a managed pointer to a scene node which ensures its onDestroyed virtual function gets called. | |
Protected Member Functions | |
template<typename ... TComponents> | |
SceneNode (const Placement &placement, const std::string &name, TComponents...components) | |
SceneNode (const nlohmann::json &jsonSceneNode) | |
SceneNode (const SceneNode &sceneObject) | |
![]() | |
BaseSceneNode (const Key &key, const Placement &placement, const std::string &name, TComponents...components) | |
Constructor for a single node of a subclass. | |
BaseSceneNode (const Placement &placement, const std::string &name, TComponents...components) | |
General constructor for a single node of a subclass. | |
BaseSceneNode (const nlohmann::json &nodeDescription) | |
Constructs a new node of a certain type based on its json description. | |
BaseSceneNode (const SceneNodeCore &other) | |
Constructs a new node of a certain type as a copy of another node. | |
![]() | |
virtual void | joinWorld (ECSWorld &world) |
Removes this node's entity from its current ECSWorld and adds it to a new ECSWorld. | |
template<typename ... TComponents> | |
SceneNodeCore (const Placement &placement, const std::string &name, TComponents...components) | |
Constructs a scene node object from essential and extra components. | |
SceneNodeCore (const nlohmann::json &jsonSceneNode) | |
Constructs a node based on its description of JSON, later verifying that essential components are present. | |
SceneNodeCore (const SceneNodeCore &sceneObject) | |
Constructs a new node as a copy of another node. | |
virtual void | onCreated () |
Copy assignment operator. | |
virtual void | onActivated () |
Scene node lifecycle hook for when a node is made an active part of the SceneSystem. | |
virtual void | onDeactivated () |
Scene node lifecycle hook for when a node is deactivated on the SceneSystem. | |
virtual void | onDestroyed () |
Scene node lifecycle hook for when a node (and possibly its descendants) are about to be destroyed. | |
![]() | |
Resource (int explicitlyInitializeMe) | |
Construct a new resource object. | |
![]() | |
IResource ()=default | |
Construct a new IResource object. | |
Friends | |
class | BaseSceneNode< SceneNode > |
Additional Inherited Members | |
![]() | |
virtual | ~SceneNodeCore ()=default |
Destroys SceneNodeCore. | |
template<typename TComponent> | |
void | addComponent (const TComponent &component, const bool bypassSceneActivityCheck=false) |
Adds a component of type TComponent to the node. | |
void | addComponent (const nlohmann::json &jsonComponent, const bool bypassSceneActivityCheck=false) |
Adds a component to the node. | |
template<typename TComponent> | |
TComponent | getComponent (const float simulationProgress=1.f) const |
Retrieves a component belonging to this node. | |
template<typename TComponent> | |
bool | hasComponent () const |
Tests whether this node has a component of a specific type. | |
bool | hasComponent (const std::string &type) const |
Tests whether this node has a component of a specific type. | |
template<typename TComponent> | |
void | updateComponent (const TComponent &component) |
Updates the value of a component of this node (to what it should be at the start of the next simulation step). | |
void | updateComponent (const nlohmann::json &component) |
Updates the value of a component of this node (to what it should be at the start of the next simulation step). | |
template<typename TComponent> | |
void | addOrUpdateComponent (const TComponent &component, const bool bypassSceneActivityCheck=false) |
A method for adding a component or updating a component if that component is already present on this node. | |
void | addOrUpdateComponent (const nlohmann::json &component, const bool bypassSceneActivityCheck=false) |
A method for adding a component, or updating a component if the same type of component is already present on this node. | |
template<typename TComponent> | |
void | removeComponent () |
Removes a component present on this node. | |
template<typename TSystem> | |
void | setEnabled (bool state) |
Sets whether or not a given system should be able to influence this scene object. | |
template<typename TSystem> | |
bool | getEnabled () const |
Returns whether a particular system has been enabled for this node. | |
EntityID | getEntityID () const |
Returns the entity id associated with these scene node. | |
WorldID | getWorldID () const |
Returns the ID of the ECSWorld this node belongs to. | |
UniversalEntityID | getUniversalEntityID () const |
Gets the UniversalEntityID aka the world-entity-id pair associated with this node. | |
std::weak_ptr< ECSWorld > | getWorld () const |
Gets a reference to the ECSWorld this node belongs to. | |
bool | inScene () const |
Returns whether this node is present as part of the SceneSystem's scene tree. | |
bool | isActive () const |
Returns whether this node is present as part of the SceneSystem's scene tree, AND is active there as well. | |
bool | isAncestorOf (std::shared_ptr< const SceneNodeCore > sceneNode) const |
Tests whether a particular scene node is the ancestor of this one. | |
bool | hasNode (const std::string &pathToChild) const |
Tests whether a node specified by some path relative to this node is a real descendant of this node. | |
void | addNode (std::shared_ptr< SceneNodeCore > node, const std::string &where) |
Adds a node (or a tree of them) as a child of the node specified by the path in the argument. | |
std::vector< std::shared_ptr< SceneNodeCore > > | getChildren () |
Returns a list of all of this node's immediate children scene nodes. | |
std::vector< std::shared_ptr< const SceneNodeCore > > | getChildren () const |
Returns a list of all of this node's immediate children scene nodes. | |
std::vector< std::shared_ptr< SceneNodeCore > > | getDescendants () |
Gets all of the descendant nodes belonging to this scene node. | |
template<typename TObject = std::shared_ptr<SceneNode>> | |
TObject | getByPath (const std::string &where) |
Gets a reference to a node or related object by its path. | |
template<typename TSceneNode = SceneNode> | |
std::shared_ptr< TSceneNode > | getNodeByID (EntityID entityID) |
Gets a pointer to a node by its EntityID, assuming that node and this one belong to the same ECSWorld. | |
std::string | getPathFromAncestor (std::shared_ptr< const SceneNodeCore > ancestor) const |
Gets the path from a node (assumed to be an ancestor) to this node. | |
virtual std::shared_ptr< ViewportNode > | getLocalViewport () |
Returns the viewport node which is in the same ECSWorld as and is the closest ancestor of (or the same as) this node. | |
virtual std::shared_ptr< const ViewportNode > | getLocalViewport () const |
Returns (a constant reference to) the viewport node which is in the same ECSWorld as and is the closes ancestor of (or the same as) this node. | |
std::shared_ptr< SceneNodeCore > | getNode (const std::string &where) |
Gets a reference to a scene node (of any valid type) based on its path relative to this node. | |
std::shared_ptr< SceneNodeCore > | getParentNode () |
Gets the parent node of this node, if one is present. | |
std::shared_ptr< const SceneNodeCore > | getParentNode () const |
Gets (a constant reference to) the parent node of this node, if one is present. | |
std::shared_ptr< SceneNodeCore > | removeNode (const std::string &where) |
Removes a node from the tree present at the path specified. | |
std::vector< std::shared_ptr< SceneNodeCore > > | removeChildren () |
Disconnects and removes all the child nodes attached to this node. | |
std::string | getName () const |
Returns the name string for this node. | |
void | setName (const std::string &name) |
Sets the name of this node. | |
std::string | getViewportLocalPath () const |
Gets the path of this node relative to its local viewport node. | |
void | setPrototype_ (std::shared_ptr< SceneNodeCore > prototype) |
A reference to the node which was used in order to construct this one. | |
template<> | |
void | setEnabled (bool state) |
template<> | |
void | removeComponent () |
template<> | |
void | removeComponent () |
template<> | |
void | removeComponent () |
template<> | |
void | setEnabled (bool) |
template<> | |
void | updateComponent (const AxisAlignedBounds &axisAlignedBoxBounds) |
template<> | |
void | updateComponent (const ObjectBounds &objectBounds) |
template<> | |
void | removeComponent () |
template<> | |
void | removeComponent () |
![]() | |
std::string | getResourceTypeName_ () const override |
Get the resource type string for this resource. | |
![]() | |
virtual | ~IResource ()=default |
Destroy the IResource object. | |
![]() | |
static std::shared_ptr< SceneNode > | create (const Key &, const Placement &placement, const std::string &name, TComponents...components) |
A (private) method for the creation of a new scene node for a particular type. | |
static std::shared_ptr< SceneNode > | create (const Placement &placement, const std::string &name, TComponents...components) |
A method for creating a scene node of a specific type (TSceneNode) | |
static std::shared_ptr< SceneNode > | create (const nlohmann::json &sceneNodeDescription) |
Creates a scene node of a type based on its description in JSON. | |
static std::shared_ptr< SceneNode > | copy (const std::shared_ptr< const SceneNode > sceneNode) |
Creates a scene node of a specific type based on another node of that type. | |
![]() | |
static std::shared_ptr< SceneNodeCore > | copy (const std::shared_ptr< const SceneNodeCore > other) |
Creates a new scene tree by copying another scene node and its descendants. | |
static void | validateName (const std::string &nodeName) |
Tests whether a given name is actually valid, throwing an error when it is not. | |
![]() | |
template<typename TResource> | |
static void | RegisterResource () |
Registers this resource as a Resource type with the ResourceDatabase. | |
The most basic vanilla flavour of scene node comprised of no more than a name and some components.