Brunot
Loading...
Searching...
No Matches
gobj::PathNode Struct Referenceabstract

internal type for computing Paths More...

#include <PathNode.h>

Inheritance diagram for gobj::PathNode:
[legend]
Collaboration diagram for gobj::PathNode:
[legend]

Classes

class  path_iterator
 iterator type, refers to a GameObject, and holds onto a reference to a PathNode to determine its range More...

Public Member Functions

virtual ~PathNode ()=default
virtual auto begin () -> path_iterator=0
virtual auto end () -> path_iterator=0
virtual auto begin (path_iterator begin, path_iterator end) -> path_iterator=0
 Traverses the linked list of PathNode s to calculate the beginning of the range of GameObjects.
virtual auto end (path_iterator begin, path_iterator end) -> path_iterator=0
 Traverses the linked list of PathNode s to find the proper end to the range of GameObjects.
virtual auto getNext (GameObject *ptr) -> GameObject *=0
 Used by PathNode::path_iterator to increment.
auto appendPathNode (std::shared_ptr< PathNode > nextPath) -> void
 adds a path to the end of the linked list of paths

Static Public Member Functions

static auto getChildren (const GameObject &gobj) -> std::shared_ptr< std::vector< GameObject * > >
 helper function to get children of GameObjects as a vector of pointers

Public Attributes

friend GameObject

Protected Member Functions

auto getBegin () const -> path_iterator
 function to get the cached beginning of our parent ( or left ) range
auto setBegin (const path_iterator &begin) -> void
 function to set the cached beginning of our parent ( or left ) range
auto getEnd () const -> path_iterator
 function to get the cached beginning of our parent ( or left ) range
auto setEnd (const path_iterator &end) -> void
 function to set the cached end of our parent ( or left ) range

Static Protected Member Functions

static auto isNamed (const GameObject &obj, const std::string &name) -> bool
 helper function that checks nickname, and then typename if nickname doesn't match used by PathName

Protected Attributes

std::shared_ptr< PathNodenext
 next Path Node in linked list. Represents the next (right) range

Private Attributes

path_iterator begin_
 Caches beginning of parent (left) range.
path_iterator end_
 Cached past the end iterator of parent ( left ) range.

Detailed Description

internal type for computing Paths

Constructor & Destructor Documentation

◆ ~PathNode()

virtual gobj::PathNode::~PathNode ( )
virtualdefault

Member Function Documentation

◆ appendPathNode()

auto gobj::PathNode::appendPathNode ( std::shared_ptr< PathNode > nextPath) ->void

adds a path to the end of the linked list of paths

Parameters
nextPaththe path to append
Here is the caller graph for this function:

◆ begin() [1/2]

virtual auto gobj::PathNode::begin ( ) ->path_iterator
pure virtual
Returns
iterator to the beginning of the range

Implemented in gobj::PathBase, gobj::PathDir, gobj::PathFilter, gobj::PathName, gobj::PathRoot, and gobj::PathUp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ begin() [2/2]

virtual auto gobj::PathNode::begin ( path_iterator begin,
path_iterator end )->path_iterator
pure virtual

Traverses the linked list of PathNode s to calculate the beginning of the range of GameObjects.

One of the main functions for calculating a path. Takes the left range, and applies whatever modifier the specific PathNode represents (filter by name, filter arbitrarily, get parent, get children, etc.) then gives it's range to the right (next) range, which continues the sequence. Once the end of the linked list is reached, an iterator to the beginning of the final range is returned.

Parameters
beginthe beginning of the parents ( or left ) range
endsentinel iterator (past the end) of the parents ( left ) range
Returns
iterator to the beginning of the final iterators range

Implemented in gobj::PathBase, gobj::PathDir, gobj::PathFilter, gobj::PathName, gobj::PathRoot, and gobj::PathUp.

Here is the call graph for this function:

◆ end() [1/2]

virtual auto gobj::PathNode::end ( ) ->path_iterator
pure virtual
Returns
iterator past the end of the range

Implemented in gobj::PathBase, gobj::PathDir, gobj::PathFilter, gobj::PathName, gobj::PathRoot, and gobj::PathUp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ end() [2/2]

virtual auto gobj::PathNode::end ( path_iterator begin,
path_iterator end )->path_iterator
pure virtual

Traverses the linked list of PathNode s to find the proper end to the range of GameObjects.

Parameters
beginbeginning of parents ( or left ) range. Doesn't need to be the actual beginning, because end doesn't depend on beginning at all
endend of parent ( or left ) range.
Returns
iterator to the end

Implemented in gobj::PathBase, gobj::PathDir, gobj::PathFilter, gobj::PathName, gobj::PathRoot, and gobj::PathUp.

Here is the call graph for this function:

◆ getBegin()

auto gobj::PathNode::getBegin ( ) const->path_iterator
nodiscardprotected

function to get the cached beginning of our parent ( or left ) range

Returns
iterator to the beginning of our parent range
Here is the caller graph for this function:

◆ getChildren()

auto gobj::PathNode::getChildren ( const GameObject & gobj) ->std::shared_ptr< std::vector< GameObject * > >
static

helper function to get children of GameObjects as a vector of pointers

Parameters
gobjGameObject to get children of
Returns
shared pointer to a vector of GameObject pointers
Here is the caller graph for this function:

◆ getEnd()

auto gobj::PathNode::getEnd ( ) const->path_iterator
nodiscardprotected

function to get the cached beginning of our parent ( or left ) range

Returns
iterator past the end of our parent range
Here is the caller graph for this function:

◆ getNext()

virtual auto gobj::PathNode::getNext ( GameObject * ptr) ->GameObject *
pure virtual

Used by PathNode::path_iterator to increment.

Takes in a pointer to a GameObject, and returns the pointer to the next GameObject in the range.

Parameters
ptrto a GameObject in the range of the PathNode
Returns
to a GameObject directly after ptr in the range

Implemented in gobj::PathBase, gobj::PathDir, gobj::PathFilter, gobj::PathName, gobj::PathRoot, and gobj::PathUp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isNamed()

auto gobj::PathNode::isNamed ( const GameObject & obj,
const std::string & name )->bool
staticprotected

helper function that checks nickname, and then typename if nickname doesn't match used by PathName

Here is the caller graph for this function:

◆ setBegin()

auto gobj::PathNode::setBegin ( const path_iterator & begin) ->void
protected

function to set the cached beginning of our parent ( or left ) range

Parameters
beginiterator to cache
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setEnd()

auto gobj::PathNode::setEnd ( const path_iterator & end) ->void
protected

function to set the cached end of our parent ( or left ) range

Parameters
pastthe end iterator to cache
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ begin_

path_iterator gobj::PathNode::begin_
private

Caches beginning of parent (left) range.

◆ end_

path_iterator gobj::PathNode::end_
private

Cached past the end iterator of parent ( left ) range.

◆ GameObject

friend gobj::PathNode::GameObject

◆ next

std::shared_ptr<PathNode> gobj::PathNode::next
protected

next Path Node in linked list. Represents the next (right) range


The documentation for this struct was generated from the following files:
  • /home/egrazil/sites/Brunot/The House/source/Utility/Path/private/PathNode.h
  • /home/egrazil/sites/Brunot/The House/source/Utility/Path/private/PathNode.cpp