Brunot
Loading...
Searching...
No Matches
gobj Namespace Reference

namespace for things relating to GameObject, other than GameObject itself More...

Classes

class  Path
 An object that represents where a GameObject or a range of GameObjects exists in the Engine. More...
struct  PathBase
 Starts a range with an arbitrary GameObject. More...
struct  PathDir
 Given a range of GameObjects, generates a range of all of those GameObjects children. More...
struct  PathFilter
 Internal PathNode that takes a range of GameObjects on the left, and filters the range to only GameObjects fulfilling a predicate. More...
struct  PathName
 Internal PathNode that takes a range of GameObjects on the left, and filters the range to only GameObjects matching a given name. More...
struct  PathNode
 internal type for computing Paths More...
struct  PathRoot
 Path Node that represents the Root object in the Engine, and provides a starting point for a Path. More...
struct  PathUp
 Internal Path Node that takes a range of GameObjects on the left, and transforms the range into the parent of every GameObject in the range. More...

Typedefs

using UUID = unsigned int

Enumerations

enum class  Type {
  null_obj_type = 0 , no_parent_type = 100 , Engine = 200 , Root = 300 ,
  Node = 400 , ChildrenHandler = 500 , System = 600 , Entity = 700 ,
  Component = 800 , Action = 900 , Script = 1000
}

Functions

auto moveEntity (Entity &entityToMove, Entity &newParent) -> void
 Makes the provided entity a child of another entity.
auto operator< (const GameObject &lhs, const GameObject &rhs) -> bool
 default comparator for gameobjects.
template<std::derived_from< GameObject > Gobj, typename ... Args>
constexpr auto FormatPath (const std::format_string< Args... > &&fmt_path, Args &&... args) -> Path< Gobj >
 Constructs a Path by parsing a string, and uses string formatting.
template<std::derived_from< GameObject > Gobj, typename ... Args>
constexpr auto FormatPath (GameObject &rootObject, const std::format_string< Args... > &&fmt_path, Args &&... args) -> Path< Gobj >
 Constructs a Path by parsing a string, and uses string formatting.

Detailed Description

namespace for things relating to GameObject, other than GameObject itself

Typedef Documentation

◆ UUID

using gobj::UUID = unsigned int

Enumeration Type Documentation

◆ Type

enum class gobj::Type
strong
Enumerator
null_obj_type 
no_parent_type 
Engine 
Root 
Node 
ChildrenHandler 
System 
Entity 
Component 
Action 
Script 

Function Documentation

◆ FormatPath() [1/2]

template<std::derived_from< GameObject > Gobj, typename ... Args>
auto gobj::FormatPath ( const std::format_string< Args... > && fmt_path,
Args &&... args )->Path< Gobj >
constexpr

Constructs a Path by parsing a string, and uses string formatting.

Template Parameters
GobjGobj The type of GameObject you are searching for. Automatically casts to the proper type, and filters out other types at the end. Defaults to GameObject, with no casts or filters
Argsthe types that will be put into the formatting
Parameters
fmt_patha string to construct the path from, which allows for {} formatting like std::format
argsthe items that will be inserted into the string
Returns
a new Path
Here is the caller graph for this function:

◆ FormatPath() [2/2]

template<std::derived_from< GameObject > Gobj, typename ... Args>
auto gobj::FormatPath ( GameObject & rootObject,
const std::format_string< Args... > && fmt_path,
Args &&... args )->Path< Gobj >
constexpr

Constructs a Path by parsing a string, and uses string formatting.

Template Parameters
GobjGobj The type of GameObject you are searching for. Automatically casts to the proper type, and filters out other types at the end. Defaults to GameObject, with no casts or filters
Argsthe types that will be put into the formatting
Parameters
rootObjecta reference to the object to start the Path from
fmt_patha string to construct the path from, which allows for {} formatting like std::format
argsthe items that will be inserted into the string
Returns
a new Path

◆ moveEntity()

auto gobj::moveEntity ( Entity & entityToMove,
Entity & newParent )->void

Makes the provided entity a child of another entity.

Parameters
entityToMoveThe entity you want to be moved
newParentThe parent you want the entity to move to be a child of

◆ operator<()

auto gobj::operator< ( const GameObject & lhs,
const GameObject & rhs )->bool

default comparator for gameobjects.

currently implemented only to sort based on UUID, so gameobjects are sorted arbitrarily, but consistently (until a copy operation)

Parameters
lhs
rhs
Returns
true if lhs UUID is less than rhs UUID
Todo
: Organize System's properly