using System;
namespace Substrate.Core
{
public enum BlockCollectionEdge
{
EAST = 0,
NORTH = 1,
WEST = 2,
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 ();
}
///
/// 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; }
}
///
/// Provides a common interface for block containers that provide global management.
///
public interface IBlockManager : IAlphaBlockCollection
{
}
}