2011-04-06 04:43:54 +00:00
using System ;
2011-06-29 02:58:34 +00:00
namespace Substrate.Core
2011-04-06 04:43:54 +00:00
{
2011-05-13 03:09:57 +00:00
public enum BlockCollectionEdge
{
EAST = 0 ,
NORTH = 1 ,
WEST = 2 ,
SOUTH = 3
}
2011-07-07 04:27:48 +00:00
/// <summary>
/// A basic block type.
/// </summary>
2011-04-06 04:43:54 +00:00
public interface IBlock
2011-04-08 02:16:06 +00:00
{
2011-07-07 04:27:48 +00:00
/// <summary>
/// Gets a variety of info and attributes on the block's type.
/// </summary>
2011-04-08 02:16:06 +00:00
BlockInfo Info { get ; }
2011-07-07 04:27:48 +00:00
/// <summary>
/// Gets or sets the block's id (type).
/// </summary>
2011-04-08 02:16:06 +00:00
int ID { get ; set ; }
2011-05-13 03:09:57 +00:00
}
2011-07-07 04:27:48 +00:00
/// <summary>
/// A block type supporting a data field.
/// </summary>
2011-05-13 03:09:57 +00:00
public interface IDataBlock : IBlock
{
2011-07-07 04:27:48 +00:00
/// <summary>
/// Gets or sets a data value on the block.
/// </summary>
2011-04-08 02:16:06 +00:00
int Data { get ; set ; }
}
2011-07-07 04:27:48 +00:00
/// <summary>
/// A block type supporting dual-source lighting.
/// </summary>
2011-04-08 02:16:06 +00:00
public interface ILitBlock : IBlock
{
2011-07-07 04:27:48 +00:00
/// <summary>
/// Gets or sets the block-source light value on this block.
/// </summary>
2011-04-08 02:16:06 +00:00
int BlockLight { get ; set ; }
2011-07-07 04:27:48 +00:00
/// <summary>
/// Gets or sets the sky-source light value on this block.
/// </summary>
2011-04-08 02:16:06 +00:00
int SkyLight { get ; set ; }
}
2011-07-07 04:27:48 +00:00
/// <summary>
/// A block type supporting properties.
/// </summary>
2011-04-08 02:16:06 +00:00
public interface IPropertyBlock : IBlock
{
2011-07-07 04:27:48 +00:00
/// <summary>
/// Gets a tile entity attached to this block.
/// </summary>
/// <returns>A <see cref="TileEntity"/> for this block, or null if this block type does not support a tile entity.</returns>
2011-04-08 02:16:06 +00:00
TileEntity GetTileEntity ( ) ;
2011-07-07 04:27:48 +00:00
/// <summary>
/// Sets the tile entity attached to this block.
/// </summary>
/// <param name="te">A <see cref="TileEntity"/> supported by this block type.</param>
/// <exception cref="ArgumentException">Thrown when the <see cref="TileEntity"/> being passed is of the wrong type for the given block.</exception>
/// <exception cref="InvalidOperationException">Thrown when the given block is of a type that does not support a <see cref="TileEntity"/> record.</exception>
2011-05-13 03:09:57 +00:00
void SetTileEntity ( TileEntity te ) ;
2011-07-07 04:27:48 +00:00
/// <summary>
/// Creates a default tile entity for this block consistent with its type.
/// </summary>
/// <remarks>This method will overwrite any existing <see cref="TileEntity"/> attached to the block.</remarks>
/// <exception cref="InvalidOperationException">Thrown when the given block is of a type that does not support a <see cref="TileEntity"/> record.</exception>
/// <exception cref="UnknownTileEntityException">Thrown when the block type requests a <see cref="TileEntity"/> that has not been registered with the <see cref="TileEntityFactory"/>.</exception>
void CreateTileEntity ( ) ;
/// <summary>
/// Deletes the tile entity attached to this block if one exists.
/// </summary>
2011-05-13 03:09:57 +00:00
void ClearTileEntity ( ) ;
2011-04-08 02:16:06 +00:00
}
2011-07-07 04:27:48 +00:00
/// <summary>
/// An Alpha-compatible context-free block type supporting data and properties.
/// </summary>
2011-06-10 16:08:36 +00:00
public interface IAlphaBlock : IDataBlock , IPropertyBlock
{
}
2011-07-07 04:27:48 +00:00
/// <summary>
/// An Alpha-compatible block reference type supporting data, lighting, and properties.
/// </summary>
2011-06-10 16:08:36 +00:00
public interface IAlphaBlockRef : IDataBlock , ILitBlock , IPropertyBlock
{
2011-07-07 04:27:48 +00:00
/// <summary>
/// Checks if the reference and its backing container are currently valid.
/// </summary>
2011-06-30 03:59:20 +00:00
bool IsValid { get ; }
2011-06-10 16:08:36 +00:00
}
2011-07-07 04:27:48 +00:00
/// <summary>
/// Provides a common interface for block containers that provide global management.
/// </summary>
2011-05-13 03:09:57 +00:00
public interface IBlockManager : IAlphaBlockCollection
2011-04-10 21:04:33 +00:00
{
2011-04-08 02:16:06 +00:00
}
2011-04-06 04:43:54 +00:00
}