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-06-10 16:08:36 +00:00
|
|
|
|
public interface IAlphaBlock : IDataBlock, IPropertyBlock
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public interface IAlphaBlockRef : IDataBlock, ILitBlock, IPropertyBlock
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
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);
|
|
|
|
|
|
2011-05-13 03:21:53 +00:00
|
|
|
|
int GetID (int x, int y, int z);
|
|
|
|
|
void SetID (int x, int y, int z, int id);
|
2011-04-08 02:16:06 +00:00
|
|
|
|
|
2011-05-13 03:21:53 +00:00
|
|
|
|
BlockInfo GetInfo (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
|
|
|
|
|
2011-05-13 03:21:53 +00:00
|
|
|
|
int CountByID (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);
|
|
|
|
|
|
2011-05-13 03:21:53 +00:00
|
|
|
|
int GetData (int x, int y, int z);
|
|
|
|
|
void SetData (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
|
|
|
|
|
{
|
2011-05-13 03:21:53 +00:00
|
|
|
|
int CountByData (int id, int data);
|
2011-05-13 03:09:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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);
|
2011-05-13 03:21:53 +00:00
|
|
|
|
int GetSkyLight (int x, int y, int z);
|
2011-04-08 02:16:06 +00:00
|
|
|
|
|
2011-05-13 03:09:57 +00:00
|
|
|
|
void SetBlockLight (int x, int y, int z, int light);
|
2011-05-13 03:21:53 +00:00
|
|
|
|
void SetSkyLight (int x, int y, int z, int light);
|
2011-05-13 03:09:57 +00:00
|
|
|
|
|
|
|
|
|
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);
|
2011-05-13 03:21:53 +00:00
|
|
|
|
void UpdateSkyLight (int x, int y, int z);
|
2011-05-13 03:09:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public interface IBoundedLitBlockCollection : ILitBlockCollection, IBoundedBlockCollection
|
|
|
|
|
{
|
|
|
|
|
// Zero out light in entire collection
|
|
|
|
|
void ResetBlockLight ();
|
2011-05-13 03:21:53 +00:00
|
|
|
|
void ResetSkyLight ();
|
2011-05-13 03:09:57 +00:00
|
|
|
|
|
|
|
|
|
// Recalculate light in entire collection
|
|
|
|
|
void RebuildBlockLight ();
|
2011-05-13 03:21:53 +00:00
|
|
|
|
void RebuildSkyLight ();
|
2011-05-13 03:09:57 +00:00
|
|
|
|
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 ();
|
2011-05-13 03:21:53 +00:00
|
|
|
|
void StitchSkyLight ();
|
2011-04-19 01:24:26 +00:00
|
|
|
|
|
2011-05-13 03:09:57 +00:00
|
|
|
|
void StitchBlockLight (IBoundedLitBlockCollection blockset, BlockCollectionEdge edge);
|
2011-05-13 03:21:53 +00:00
|
|
|
|
void StitchSkyLight (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
|
|
|
|
}
|