Show / Hide Table of Contents

Class Block

Base type for all block world blocks.

Inheritance
System.Object
Block
DirtBlock
EmptyBlock
EncasedWaterBlock
ImpenetrableStoneBlock
MudBlock
PetrolBlock
RailTrackBlock
SandBlock
SewageBlock
TailingsBlock
TreeBlock
WaterBlock
WetTailingsBlock
Namespace: Eco.World.Blocks
Assembly: Eco.World.dll
Syntax
public abstract class Block : Object

Constructors

Block()

Declaration
protected Block()

Properties

Empty

A constant empty block that represents air.

Declaration
public static Block Empty { get; }
Property Value
Type Description
Block

Methods

BlockTypesWithAttribute(Type)

Declaration
public static IEnumerable<Type> BlockTypesWithAttribute(Type block)
Parameters
Type Name Description
System.Type block
Returns
Type Description
System.Collections.Generic.IEnumerable<System.Type>

Get<T>()

Declaration
public T Get<T>()
    where T : BlockAttribute
Returns
Type Description
T
Type Parameters
Name Description
T

Get<T>(Type)

Declaration
public static T Get<T>(Type blockType)
    where T : BlockAttribute
Parameters
Type Name Description
System.Type blockType
Returns
Type Description
T
Type Parameters
Name Description
T

Initialize()

Declaration
public static void Initialize()

Is<T>()

Declaration
public bool Is<T>()
    where T : BlockAttribute
Returns
Type Description
System.Boolean
Type Parameters
Name Description
T

Is<T>(Type)

Declaration
public static bool Is<T>(Type blockType)
    where T : BlockAttribute
Parameters
Type Name Description
System.Type blockType
Returns
Type Description
System.Boolean
Type Parameters
Name Description
T

IsAny<T1, T2>()

Checks if Block is either T1 or T2. More efficient than block.Is<T1>() || block.Is<T2>().

Declaration
public bool IsAny<T1, T2>()
Returns
Type Description
System.Boolean
Type Parameters
Name Description
T1
T2

IsWater()

Declaration
public bool IsWater()
Returns
Type Description
System.Boolean

TryGet<T>(out T)

Declaration
public bool TryGet<T>(out T blockAttribute)
    where T : BlockAttribute
Parameters
Type Name Description
T blockAttribute
Returns
Type Description
System.Boolean
Type Parameters
Name Description
T

Extension Methods

BlockExtensions.GetID(Block)
☀
☾
In This Article
Back to top
Copyright (c) Strange Loop Games 2021
☀
☾