Empeld
Empeld plugin documentation.
essentials.Prefabs.PrefabInstance Class Reference

An object that represents an in-world instance of a prefab More...

Inheritance diagram for essentials.Prefabs.PrefabInstance:
essentials.Prefabs.PrefabWriterInstance

Public Member Functions

delegate bool PrefabLookupDelegate (PrefabBlock pb)
 A delegate to help determine ways to look up a prefab More...
 
 PrefabInstance (IReadonlyPrefab prefab, Vector3i pos)
 Create an instance from a given prefab and a world position More...
 

Static Public Attributes

static readonly PrefabLookupDelegate PredicateAll = pb => true
 Lookup that will return all blocks More...
 
static readonly PrefabLookupDelegate PredicateNoInvisible = pb => pb.Block.Renderable
 Lookup that will return all blocks that are renderable More...
 
static readonly PrefabLookupDelegate PredicateOnlySolid = pb => pb.Block.Solid
 Lookup that will only return solid blocks More...
 
static readonly PrefabLookupDelegate PredicateNoEmpty = pb => pb.Block.Id != 0
 Look that will return all blocks except those that are empty (id 0) More...
 

Protected Attributes

readonly IWorld World
 World More...
 

Properties

Vector3i Position [get]
 The position of the instance More...
 
Vector3i WorldPositionMin [get]
 The min coord for world position More...
 
Vector3i WorldPositionMax [get]
 The max coord for world position More...
 
IReadonlyPrefab Prefab [get]
 The prefab that this instance represents More...
 
Size3i Size [get]
 The size of the prefab More...
 
Volume Area [get]
 The world-area of the prefab More...
 

Detailed Description

An object that represents an in-world instance of a prefab

Constructor & Destructor Documentation

◆ PrefabInstance()

essentials.Prefabs.PrefabInstance.PrefabInstance ( IReadonlyPrefab  prefab,
Vector3i  pos 
)

Create an instance from a given prefab and a world position

Parameters
prefabPrefab.
posPosition.
119  {
120  this.InjectDependencies();
121  _prefab = prefab;
122  _position = pos;
123  }

Member Function Documentation

◆ PrefabLookupDelegate()

delegate bool essentials.Prefabs.PrefabInstance.PrefabLookupDelegate ( PrefabBlock  pb)

A delegate to help determine ways to look up a prefab

Member Data Documentation

◆ PredicateAll

readonly PrefabLookupDelegate essentials.Prefabs.PrefabInstance.PredicateAll = pb => true
static

Lookup that will return all blocks

◆ PredicateNoEmpty

readonly PrefabLookupDelegate essentials.Prefabs.PrefabInstance.PredicateNoEmpty = pb => pb.Block.Id != 0
static

Look that will return all blocks except those that are empty (id 0)

◆ PredicateNoInvisible

readonly PrefabLookupDelegate essentials.Prefabs.PrefabInstance.PredicateNoInvisible = pb => pb.Block.Renderable
static

Lookup that will return all blocks that are renderable

◆ PredicateOnlySolid

readonly PrefabLookupDelegate essentials.Prefabs.PrefabInstance.PredicateOnlySolid = pb => pb.Block.Solid
static

Lookup that will only return solid blocks

◆ World

readonly IWorld essentials.Prefabs.PrefabInstance.World
protected

World

Attribute: Dependency

Property Documentation

◆ Area

Volume essentials.Prefabs.PrefabInstance.Area
get

The world-area of the prefab

The area.

◆ Position

Vector3i essentials.Prefabs.PrefabInstance.Position
get

The position of the instance

The position.

◆ Prefab

IReadonlyPrefab essentials.Prefabs.PrefabInstance.Prefab
get

The prefab that this instance represents

The prefab.

◆ Size

Size3i essentials.Prefabs.PrefabInstance.Size
get

The size of the prefab

The size.

◆ WorldPositionMax

Vector3i essentials.Prefabs.PrefabInstance.WorldPositionMax
get

The max coord for world position

The world position max.

◆ WorldPositionMin

Vector3i essentials.Prefabs.PrefabInstance.WorldPositionMin
get

The min coord for world position

The world position minimum.


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