2011-04-06 04:43:54 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
2011-04-06 21:20:35 +00:00
|
|
|
|
namespace Substrate
|
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-04-06 04:43:54 +00:00
|
|
|
|
public interface IBlock
|
2011-04-08 02:16:06 +00:00
|
|
|
|
{
|
|
|
|
|
BlockInfo Info { get; }
|
|
|
|
|
int ID { get; set; }
|
2011-05-13 03:09:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public interface IDataBlock : IBlock
|
|
|
|
|
{
|
2011-04-08 02:16:06 +00:00
|
|
|
|
int Data { get; set; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public interface ILitBlock : IBlock
|
|
|
|
|
{
|
|
|
|
|
int BlockLight { get; set; }
|
|
|
|
|
int SkyLight { get; set; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public interface IPropertyBlock : IBlock
|
|
|
|
|
{
|
|
|
|
|
TileEntity GetTileEntity ();
|
2011-05-13 03:09:57 +00:00
|
|
|
|
void SetTileEntity (TileEntity te);
|
|
|
|
|
void ClearTileEntity ();
|
2011-04-08 02:16:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
2011-05-13 03:09:57 +00:00
|
|
|
|
public interface IBlockCollection
|
2011-04-08 02:16:06 +00:00
|
|
|
|
{
|
|
|
|
|
IBlock GetBlock (int x, int y, int z);
|
|
|
|
|
IBlock GetBlockRef (int x, int y, int z);
|
|
|
|
|
|
|
|
|
|
void SetBlock (int x, int y, int z, IBlock block);
|
|
|
|
|
|
|
|
|
|
int GetBlockID (int x, int y, int z);
|
2011-05-13 03:09:57 +00:00
|
|
|
|
void SetBlockID (int x, int y, int z, int id);
|
2011-04-08 02:16:06 +00:00
|
|
|
|
|
2011-05-13 03:09:57 +00:00
|
|
|
|
BlockInfo GetBlockInfo (int x, int y, int z);
|
2011-04-08 02:16:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
2011-05-13 03:09:57 +00:00
|
|
|
|
public interface IBoundedBlockCollection : IBlockCollection
|
2011-04-08 02:16:06 +00:00
|
|
|
|
{
|
|
|
|
|
int XDim { get; }
|
|
|
|
|
int YDim { get; }
|
|
|
|
|
int ZDim { get; }
|
2011-05-13 03:09:57 +00:00
|
|
|
|
|
|
|
|
|
int CountBlockID (int id);
|
2011-04-08 02:16:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
2011-05-13 03:09:57 +00:00
|
|
|
|
public interface IDataBlockCollection : IBlockCollection
|
2011-04-08 02:16:06 +00:00
|
|
|
|
{
|
2011-05-13 03:09:57 +00:00
|
|
|
|
new IDataBlock GetBlock (int x, int y, int z);
|
|
|
|
|
new IDataBlock GetBlockRef (int x, int y, int z);
|
|
|
|
|
|
|
|
|
|
void SetBlock (int x, int y, int z, IDataBlock block);
|
|
|
|
|
|
|
|
|
|
int GetBlockData (int x, int y, int z);
|
|
|
|
|
void SetBlockData (int x, int y, int z, int data);
|
2011-04-08 02:16:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
2011-05-13 03:09:57 +00:00
|
|
|
|
public interface IBoundedDataBlockCollection : IDataBlockCollection, IBoundedBlockCollection
|
|
|
|
|
{
|
|
|
|
|
int CountBlockData (int id, int data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public interface ILitBlockCollection : IBlockCollection
|
2011-04-08 02:16:06 +00:00
|
|
|
|
{
|
|
|
|
|
new ILitBlock GetBlock (int x, int y, int z);
|
|
|
|
|
new ILitBlock GetBlockRef (int x, int y, int z);
|
|
|
|
|
|
|
|
|
|
void SetBlock (int x, int y, int z, ILitBlock block);
|
|
|
|
|
|
2011-05-13 03:09:57 +00:00
|
|
|
|
// Local Light
|
2011-04-08 02:16:06 +00:00
|
|
|
|
int GetBlockLight (int x, int y, int z);
|
|
|
|
|
int GetBlockSkyLight (int x, int y, int z);
|
|
|
|
|
|
2011-05-13 03:09:57 +00:00
|
|
|
|
void SetBlockLight (int x, int y, int z, int light);
|
|
|
|
|
void SetBlockSkyLight (int x, int y, int z, int light);
|
|
|
|
|
|
|
|
|
|
int GetHeight (int x, int z);
|
|
|
|
|
void SetHeight (int x, int z, int height);
|
|
|
|
|
|
|
|
|
|
// Update and propagate light at a single block
|
|
|
|
|
void UpdateBlockLight (int x, int y, int z);
|
|
|
|
|
void UpdateBlockSkyLight (int x, int y, int z);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public interface IBoundedLitBlockCollection : ILitBlockCollection, IBoundedBlockCollection
|
|
|
|
|
{
|
|
|
|
|
// Zero out light in entire collection
|
|
|
|
|
void ResetBlockLight ();
|
|
|
|
|
void ResetBlockSkyLight ();
|
|
|
|
|
|
|
|
|
|
// Recalculate light in entire collection
|
|
|
|
|
void RebuildBlockLight ();
|
|
|
|
|
void RebuildBlockSkyLight ();
|
|
|
|
|
void RebuildHeightMap ();
|
2011-04-19 01:24:26 +00:00
|
|
|
|
|
2011-05-13 03:09:57 +00:00
|
|
|
|
// Reconcile inconsistent lighting between the edges of two containers of same size
|
|
|
|
|
void StitchBlockLight ();
|
|
|
|
|
void StitchBlockSkyLight ();
|
2011-04-19 01:24:26 +00:00
|
|
|
|
|
2011-05-13 03:09:57 +00:00
|
|
|
|
void StitchBlockLight (IBoundedLitBlockCollection blockset, BlockCollectionEdge edge);
|
|
|
|
|
void StitchBlockSkyLight (IBoundedLitBlockCollection blockset, BlockCollectionEdge edge);
|
2011-04-08 02:16:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
2011-05-13 03:09:57 +00:00
|
|
|
|
public interface IPropertyBlockCollection : IBlockCollection
|
2011-04-08 02:16:06 +00:00
|
|
|
|
{
|
|
|
|
|
new IPropertyBlock GetBlock (int x, int y, int z);
|
|
|
|
|
new IPropertyBlock GetBlockRef (int x, int y, int z);
|
|
|
|
|
|
|
|
|
|
void SetBlock (int x, int y, int z, IPropertyBlock block);
|
|
|
|
|
|
|
|
|
|
TileEntity GetTileEntity (int x, int y, int z);
|
2011-05-13 03:09:57 +00:00
|
|
|
|
void SetTileEntity (int x, int y, int z, TileEntity te);
|
|
|
|
|
|
|
|
|
|
void CreateTileEntity (int x, int y, int z);
|
|
|
|
|
void ClearTileEntity (int x, int y, int z);
|
2011-04-08 02:16:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
2011-05-13 03:09:57 +00:00
|
|
|
|
public interface IBoundedPropertyBlockCollection : IPropertyBlockCollection, IBoundedBlockCollection
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public interface IAlphaBlockCollection : IDataBlockCollection, ILitBlockCollection, IPropertyBlockCollection
|
2011-04-08 02:16:06 +00:00
|
|
|
|
{
|
2011-04-10 21:04:33 +00:00
|
|
|
|
new Block GetBlock (int x, int y, int z);
|
|
|
|
|
new BlockRef GetBlockRef (int x, int y, int z);
|
2011-05-13 03:09:57 +00:00
|
|
|
|
|
|
|
|
|
void SetBlock (int x, int y, int z, Block block);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public interface IBoundedAlphaBlockCollection : IAlphaBlockCollection, IBoundedDataBlockCollection, IBoundedLitBlockCollection, IBoundedPropertyBlockCollection
|
|
|
|
|
{
|
2011-04-08 02:16:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
|
}
|