Kerbal Space Program  1.12.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Static Public Member Functions | List of all members
HierarchyUtil Class Reference

Static Public Member Functions

static int CompareHierarchyDepths (int d1, int d2)
 
static int CompareHierarchyDepths (Part p1, Part p2)
 
static int CompareHierarchyDepths (Transform t1, Transform t2)
 
static int CompareHierarchyDepths< T > (T t1, T t2, Func< T, T > parentAccessor)
 
static string CompileID (Transform trf, string rootName)
 Generates a url-like id string from the transform up to the given root object, or the scene root if no root object provided. More...
 
static int GetHierarchyDepth (Part p)
 returns the hierarchy level the given part is from the local root. More...
 
static int GetHierarchyDepth (Transform t)
 returns the hierarchy level the given transform is from the scene root. More...
 
static int GetHierarchyDepth< T > (T o, Func< T, T > parentAccessor)
 returns the hierarchy level the given object is from the scene root, provided there is a method to access its parent. More...
 
static bool isAncestor (Part p1, Part p2)
 Returns true if p1 is a hierarchical ancestor of p2 (in any level) More...
 
static bool isAncestor (Transform t1, Transform t2)
 Returns true if t1 is a hierarchical ancestor of t2 (in any level) More...
 
static bool isAncestor< T > (T t1, T t2, Func< T, T > parentAccessor)
 Returns true if t1 is a hierarchical ancestor of t2 (in any level) More...
 
static bool isDescendant (Part p1, Part p2)
 Returns true if p1 is a hierarchical descendant of p2 (in any level) More...
 
static bool isDescendant (Transform t1, Transform t2)
 Returns true if t1 is a hierarchical descendant of t2 (in any level) More...
 
static bool isDescendant< T > (T t1, T t2, Func< T, T > parentAccessor)
 Returns true if t1 is a hierarchical descendant of t2 (in any level) More...
 
static bool isSameLevel (Part p1, Part p2)
 Returns true if p1 is on the same hierarchical level of p2 More...
 
static bool isSameLevel (Transform t1, Transform t2)
 Returns true if t1 is on the same hierarchical level of t2 More...
 
static bool isSameLevel< T > (T t1, T t2, Func< T, T > parentAccessor)
 Returns true if t1 is on the same hierarchical level of t2 More...
 

Member Function Documentation

static int HierarchyUtil.CompareHierarchyDepths ( int  d1,
int  d2 
)
inlinestatic
static int HierarchyUtil.CompareHierarchyDepths ( Part  p1,
Part  p2 
)
inlinestatic
static int HierarchyUtil.CompareHierarchyDepths ( Transform  t1,
Transform  t2 
)
inlinestatic
static int HierarchyUtil.CompareHierarchyDepths< T > ( t1,
t2,
Func< T, T >  parentAccessor 
)
inlinestatic
static string HierarchyUtil.CompileID ( Transform  trf,
string  rootName 
)
inlinestatic

Generates a url-like id string from the transform up to the given root object, or the scene root if no root object provided.

Parameters
trfThe transform to generate the id for
rootNameThe root object to search for
static int HierarchyUtil.GetHierarchyDepth ( Part  p)
inlinestatic

returns the hierarchy level the given part is from the local root.

static int HierarchyUtil.GetHierarchyDepth ( Transform  t)
inlinestatic

returns the hierarchy level the given transform is from the scene root.

static int HierarchyUtil.GetHierarchyDepth< T > ( o,
Func< T, T >  parentAccessor 
)
inlinestatic

returns the hierarchy level the given object is from the scene root, provided there is a method to access its parent.

static bool HierarchyUtil.isAncestor ( Part  p1,
Part  p2 
)
inlinestatic

Returns true if p1 is a hierarchical ancestor of p2 (in any level)

static bool HierarchyUtil.isAncestor ( Transform  t1,
Transform  t2 
)
inlinestatic

Returns true if t1 is a hierarchical ancestor of t2 (in any level)

static bool HierarchyUtil.isAncestor< T > ( t1,
t2,
Func< T, T >  parentAccessor 
)
inlinestatic

Returns true if t1 is a hierarchical ancestor of t2 (in any level)

static bool HierarchyUtil.isDescendant ( Part  p1,
Part  p2 
)
inlinestatic

Returns true if p1 is a hierarchical descendant of p2 (in any level)

static bool HierarchyUtil.isDescendant ( Transform  t1,
Transform  t2 
)
inlinestatic

Returns true if t1 is a hierarchical descendant of t2 (in any level)

static bool HierarchyUtil.isDescendant< T > ( t1,
t2,
Func< T, T >  parentAccessor 
)
inlinestatic

Returns true if t1 is a hierarchical descendant of t2 (in any level)

static bool HierarchyUtil.isSameLevel ( Part  p1,
Part  p2 
)
inlinestatic

Returns true if p1 is on the same hierarchical level of p2

static bool HierarchyUtil.isSameLevel ( Transform  t1,
Transform  t2 
)
inlinestatic

Returns true if t1 is on the same hierarchical level of t2

static bool HierarchyUtil.isSameLevel< T > ( t1,
t2,
Func< T, T >  parentAccessor 
)
inlinestatic

Returns true if t1 is on the same hierarchical level of t2


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