using System;
namespace Substrate.Core
{
///
/// Represents the cardinal direction of a block collection's neighboring collection.
///
public enum BlockCollectionEdge
{
///
/// Refers to a chunk/collection to the east of the current chunk/collection.
///
EAST = 0,
///
/// Refers to a chunk/collection to the north of the current chunk/collection.
///
NORTH = 1,
///
/// Refers to a chunk/collection to the west of the current chunk/collection.
///
WEST = 2,
///
/// Refers to a chunk/collection to the south of the current chunk/collection.
///
SOUTH = 3
}
///
/// A basic block type.
///
public interface IBlock
{
///
/// Gets a variety of info and attributes on the block's type.
///
BlockInfo Info { get; }
///
/// Gets or sets the block's id (type).
///
int ID { get; set; }
}
///
/// A block type supporting a data field.
///
public interface IDataBlock : IBlock
{
///
/// Gets or sets a data value on the block.
///
int Data { get; set; }
}
///
/// A block type supporting dual-source lighting.
///
public interface ILitBlock : IBlock
{
///
/// Gets or sets the block-source light value on this block.
///
int BlockLight { get; set; }
///
/// Gets or sets the sky-source light value on this block.
///
int SkyLight { get; set; }
}
///
/// A block type supporting properties.
///
public interface IPropertyBlock : IBlock
{
///
/// Gets a tile entity attached to this block.
///
/// A for this block, or null if this block type does not support a tile entity.
TileEntity GetTileEntity ();
///
/// Sets the tile entity attached to this block.
///
/// A supported by this block type.
/// Thrown when the being passed is of the wrong type for the given block.
/// Thrown when the given block is of a type that does not support a record.
void SetTileEntity (TileEntity te);
///
/// Creates a default tile entity for this block consistent with its type.
///
/// This method will overwrite any existing attached to the block.
/// Thrown when the given block is of a type that does not support a record.
/// Thrown when the block type requests a that has not been registered with the .
void CreateTileEntity ();
///
/// Deletes the tile entity attached to this block if one exists.
///
void ClearTileEntity ();
}
///
/// A block type supporting active tick state.
///
public interface IActiveBlock : IBlock
{
///
/// Gets a entry attached to this block.
///
/// A for this block, or null if one has not been created yet.
TileTick GetTileTick ();
///
/// Sets the attached to this block.
///
/// A representing the delay until this block is next processed in-game.
void SetTileTick (TileTick tt);
///
/// Creates a default entry for this block.
///
/// This method will overwrite any existing attached to the block.
void CreateTileTick ();
///
/// Deletes the entry attached to this block, if one exists.
///
void ClearTileTick ();
///
/// Gets or sets the the actual tick delay associated with this block.
///
/// If no underlying entry exists for this block, one will be created.
int TileTickValue { get; set; }
}
///
/// An Alpha-compatible context-free block type supporting data and properties.
///
public interface IAlphaBlock : IDataBlock, IPropertyBlock
{
}
///
/// An Alpha-compatible block reference type supporting data, lighting, and properties.
///
public interface IAlphaBlockRef : IDataBlock, ILitBlock, IPropertyBlock
{
///
/// Checks if the reference and its backing container are currently valid.
///
bool IsValid { get; }
}
///
/// A version-1.0-compatible context-free block type supporting data, properties, and active tick state.
///
public interface IVersion10Block : IAlphaBlock, IActiveBlock
{
}
///
/// A version-1.0-compatible reference type supporting data, lighting, properties, and active tick state.
///
public interface IVersion10BlockRef : IAlphaBlockRef, IActiveBlock
{
}
///
/// Provides a common interface for block containers that provide global management.
///
public interface IBlockManager : IAlphaBlockCollection
{
}
///
/// Provides a common interface for block containers that provide global management, extended through Version 1.0 capabilities.
///
public interface IVersion10BlockManager : IBlockManager, IActiveBlockCollection
{
}
}