Chunks
Moddable voxel sandbox for room-scale VR.
Public Member Functions | Properties | List of all members
Chunks.Entities.Object Class Reference

Base class for Entity and Component types, implementing manipulation and accessing of child entities or components. More...

Inheritance diagram for Chunks.Entities.Object:
Chunks.Entities.Component Chunks.Entities.Entity Chunks.Entities.Transform Chunks.Agents.GroundAgent Chunks.Audio.AmbientEmitter Chunks.Entities.Holdable Chunks.Entities.Holder Chunks.Entities.ToolTip Chunks.Geometry.AABBPhysics Chunks.Interface.CameraRig Chunks.Interface.MenuDock Chunks.Interface.Pointer Chunks.Interface.ToolIcon Chunks.Interface.TrackPadDial Chunks.Interface.Wand Chunks.Controls.ControlTransform

Public Member Functions

Entity CreateChild ()
 Creates a new Entity parented to this one. More...
 
TComponent CreateChildWithComponent< TComponent > ()
 Creates a new Entity parented to this one with a component of the given type, which is returned. More...
 
Entity FindChild (string name, bool recurse=true)
 Attempts to find a child Entity of this one with the given name, and optionally searches recursively through all children. Null is returned if no matches are found. More...
 
TComponent FindChildComponent< TComponent > (string name, bool recurse=true)
 Attempts to find a child Entity of this one with the given name, and optionally searches recursively through all children. If a matching Entity is found, a component of the given type is retrieved from it. Null is returned if no matches are found. More...
 
Entity FindParent (string name)
 Attempts to find an Entity that contains this Object's Entity with the given Name. Returns null if no match is found. More...
 
TComponent FindParentComponent< TComponent > ()
 Attempts to find an Entity that contains this Object's Entity with a component of the given type. If a matching Entity is found, the component of the given type is retrieved from it. Returns null if no match is found. More...
 
TComponent FindParentComponent< TComponent > (string name)
 Attempts to find an Entity that contains this Object's Entity with the given Name. If a matching Entity is found, a component of the given type is retrieved from it. Returns null if no match is found. More...
 
TComponent AddComponent< TComponent > ()
 Adds a component of the specified type to this entity, returning the new component. More...
 
TComponent GetOrAddComponent< TComponent > ()
 Attempts to get a component of the specified type from this entity, adding it if one doesn't already exist. More...
 
TComponent GetComponent< TComponent > ()
 Attempts to get a component of the specified type from this entity, returning null if one doesn't exist. More...
 
IEnumerable< TComponent > GetComponents< TComponent > ()
 Gets all components derived from the given type. More...
 

Properties

abstract bool IsValid [get]
 Tests to see if this object hasn't been removed. More...
 
virtual string Name [get, set]
 Custom name associated with this Object's Entity, used to find the Entity in the hierarchy. More...
 
virtual Transform Transform [get]
 Transformation of this Object's Entity. More...
 
virtual IWorld World [get]
 The IWorld that contains this Object. More...
 

Detailed Description

Base class for Entity and Component types, implementing manipulation and accessing of child entities or components.

Member Function Documentation

TComponent Chunks.Entities.Object.AddComponent< TComponent > ( )

Adds a component of the specified type to this entity, returning the new component.

Template Parameters
TComponentComponent type to add
Type Constraints
TComponent :Component 
TComponent :new() 
Entity Chunks.Entities.Object.CreateChild ( )

Creates a new Entity parented to this one.

TComponent Chunks.Entities.Object.CreateChildWithComponent< TComponent > ( )

Creates a new Entity parented to this one with a component of the given type, which is returned.

Template Parameters
TComponentType of component to add to the new Entity.
Type Constraints
TComponent :Component 
TComponent :new() 
Entity Chunks.Entities.Object.FindChild ( string  name,
bool  recurse = true 
)

Attempts to find a child Entity of this one with the given name, and optionally searches recursively through all children. Null is returned if no matches are found.

Parameters
nameName of the Entity to find.
recurseIf true, all children of this entity are recursed through.
TComponent Chunks.Entities.Object.FindChildComponent< TComponent > ( string  name,
bool  recurse = true 
)

Attempts to find a child Entity of this one with the given name, and optionally searches recursively through all children. If a matching Entity is found, a component of the given type is retrieved from it. Null is returned if no matches are found.

Template Parameters
TComponentType of component to retrieve.
Parameters
nameName of the Entity to find.
recurseIf true, all children of this entity are recursed through.
Type Constraints
TComponent :class 
Entity Chunks.Entities.Object.FindParent ( string  name)

Attempts to find an Entity that contains this Object's Entity with the given Name. Returns null if no match is found.

Parameters
nameName of the Entity to find.
TComponent Chunks.Entities.Object.FindParentComponent< TComponent > ( )

Attempts to find an Entity that contains this Object's Entity with a component of the given type. If a matching Entity is found, the component of the given type is retrieved from it. Returns null if no match is found.

Template Parameters
TComponentType of component to retrieve.
Type Constraints
TComponent :class 
TComponent Chunks.Entities.Object.FindParentComponent< TComponent > ( string  name)

Attempts to find an Entity that contains this Object's Entity with the given Name. If a matching Entity is found, a component of the given type is retrieved from it. Returns null if no match is found.

Template Parameters
TComponentType of component to retrieve.
Parameters
nameName of the Entity to find.
Type Constraints
TComponent :class 
TComponent Chunks.Entities.Object.GetComponent< TComponent > ( )

Attempts to get a component of the specified type from this entity, returning null if one doesn't exist.

Template Parameters
TComponentComponent type to get
IEnumerable<TComponent> Chunks.Entities.Object.GetComponents< TComponent > ( )

Gets all components derived from the given type.

Template Parameters
TComponentComponent type to get
Type Constraints
TComponent :Component 
TComponent Chunks.Entities.Object.GetOrAddComponent< TComponent > ( )

Attempts to get a component of the specified type from this entity, adding it if one doesn't already exist.

Template Parameters
TComponentComponent type to get
Type Constraints
TComponent :Component 
TComponent :new() 

Property Documentation

abstract bool Chunks.Entities.Object.IsValid
get

Tests to see if this object hasn't been removed.

virtual string Chunks.Entities.Object.Name
getset

Custom name associated with this Object's Entity, used to find the Entity in the hierarchy.

virtual Transform Chunks.Entities.Object.Transform
get

Transformation of this Object's Entity.

virtual IWorld Chunks.Entities.Object.World
get

The IWorld that contains this Object.


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