Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
JumpPointCache::RowTree Struct Reference

Classes

struct  Interval
 Represents an interval [u15 x0, u16 x1) with a boolean obstruction flag, packed into a single u32. More...
 

Public Member Functions

size_t GetMemoryUsage () const
 
 RowTree (int length)
 
void SetRange (int x0, int x1, bool obstruction)
 
void ConstructTree (std::vector< Interval > &tree, size_t x0, size_t pivot, size_t x1, size_t idx_tree)
 Recursive helper function for Finish(). More...
 
void Finish ()
 
void Get (int x, int &xp, bool &obstruction) const
 

Public Attributes

std::vector< Intervaldata
 

Constructor & Destructor Documentation

◆ RowTree()

JumpPointCache::RowTree::RowTree ( int  length)
inline

Member Function Documentation

◆ ConstructTree()

void JumpPointCache::RowTree::ConstructTree ( std::vector< Interval > &  tree,
size_t  x0,
size_t  pivot,
size_t  x1,
size_t  idx_tree 
)
inline

Recursive helper function for Finish().

Given two ranges [x0, pivot) and [pivot, x1) in the sorted array 'data', the pivot element is added onto the binary tree (stored flattened in an array), and then each range is split into two sub-ranges with a pivot in the middle (to ensure the tree remains balanced) and ConstructTree recurses.

◆ Finish()

void JumpPointCache::RowTree::Finish ( )
inline

◆ Get()

void JumpPointCache::RowTree::Get ( int  x,
int &  xp,
bool &  obstruction 
) const
inline

◆ GetMemoryUsage()

size_t JumpPointCache::RowTree::GetMemoryUsage ( ) const
inline

◆ SetRange()

void JumpPointCache::RowTree::SetRange ( int  x0,
int  x1,
bool  obstruction 
)
inline

Member Data Documentation

◆ data

std::vector<Interval> JumpPointCache::RowTree::data

The documentation for this struct was generated from the following file: