Chunks
Moddable voxel sandbox for room-scale VR.
Protected Member Functions | Properties | List of all members
Chunks.Geometry.Block Class Reference

Resource for a type of block, specifying its appearance, whether it can be placed by a player, and its resistance to damage. More...

Inheritance diagram for Chunks.Geometry.Block:
Chunks.Plugins.PluginResource

Protected Member Functions

override void OnReadDefinition (JToken token, string directory)
 When overridden in an inheriting class, handles reading information about the resource from a json token. More...
 
- Protected Member Functions inherited from Chunks.Plugins.PluginResource
 PluginResource ()
 
void AssertIsValid ()
 
virtual void OnInitialize ()
 
ResourceName GetResourceName (JToken token)
 Converts a json token to a resource name, associating it with the current namespace. Only valid from within OnReadDefinition. More...
 
ResourceName GetResourceName (JToken token, ResourceName @default)
 Converts a json token to a resource name, associating it with the current namespace. Only valid from within OnReadDefinition. If the token is null, default is used. More...
 

Properties

float DamageMultiplier [get]
 The amount damage is scaled before applied to the block, default is 1. More...
 
bool CanPlace [get]
 If true, players can select and place this block. More...
 
bool IsEmpty [get]
 
Surface this[Face face] [get]
 Gets the specified face's surface info from this block. More...
 
- Properties inherited from Chunks.Plugins.PluginResource
Plugin Plugin [get]
 Plugin this resource was loaded from. More...
 
ResourceName Name [get]
 Name of this resource. More...
 

Additional Inherited Members

- Public Member Functions inherited from Chunks.Plugins.PluginResource
override string ToString ()
 Returns the fully qualified name of this resource. More...
 
- Public Attributes inherited from Chunks.Plugins.PluginResource
bool IsValid => Plugin == null || Plugin.IsLoaded
 

Detailed Description

Resource for a type of block, specifying its appearance, whether it can be placed by a player, and its resistance to damage.

Member Function Documentation

override void Chunks.Geometry.Block.OnReadDefinition ( JToken  token,
string  directory 
)
protectedvirtual

When overridden in an inheriting class, handles reading information about the resource from a json token.

Parameters
tokenToken to load the resource from
directoryLocation of the loaded json file's parent directory

Reimplemented from Chunks.Plugins.PluginResource.

Property Documentation

bool Chunks.Geometry.Block.CanPlace
get

If true, players can select and place this block.

float Chunks.Geometry.Block.DamageMultiplier
get

The amount damage is scaled before applied to the block, default is 1.

bool Chunks.Geometry.Block.IsEmpty
get
Surface Chunks.Geometry.Block.this[Face face]
get

Gets the specified face's surface info from this block.

Parameters
faceFace to retrieve the surface info from

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