2011-04-06 04:43:54 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.IO;
|
|
|
|
|
|
2011-04-06 21:20:35 +00:00
|
|
|
|
namespace Substrate
|
2011-04-06 04:43:54 +00:00
|
|
|
|
{
|
|
|
|
|
|
2011-04-08 02:16:06 +00:00
|
|
|
|
public interface IChunk : IBoundedBlockContainer, IAlphaBlockContainer, IEntityContainer
|
2011-04-06 04:43:54 +00:00
|
|
|
|
{
|
|
|
|
|
int X { get; }
|
|
|
|
|
int Z { get; }
|
|
|
|
|
|
|
|
|
|
bool IsTerrainPopulated { get; set; }
|
|
|
|
|
|
|
|
|
|
bool Save (Stream outStream);
|
|
|
|
|
|
|
|
|
|
int CountBlockID (int id);
|
|
|
|
|
int CountBlockData (int id, int data);
|
|
|
|
|
|
2011-04-06 23:54:41 +00:00
|
|
|
|
int CountEntities ();
|
|
|
|
|
|
2011-04-06 04:43:54 +00:00
|
|
|
|
int GetHeight (int lx, int lz);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public interface IChunkCache
|
|
|
|
|
{
|
|
|
|
|
bool MarkChunkDirty (ChunkRef chunk);
|
|
|
|
|
bool MarkChunkClean (ChunkRef chunk);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public interface IChunkContainer
|
|
|
|
|
{
|
|
|
|
|
int ChunkGlobalX (int cx);
|
|
|
|
|
int ChunkGlobalZ (int cz);
|
|
|
|
|
|
|
|
|
|
int ChunkLocalX (int cx);
|
|
|
|
|
int ChunkLocalZ (int cz);
|
|
|
|
|
|
|
|
|
|
Chunk GetChunk (int cx, int cz);
|
|
|
|
|
ChunkRef GetChunkRef (int cx, int cz);
|
|
|
|
|
|
|
|
|
|
bool ChunkExists (int cx, int cz);
|
|
|
|
|
|
|
|
|
|
bool DeleteChunk (int cx, int cz);
|
|
|
|
|
|
|
|
|
|
int Save ();
|
|
|
|
|
bool SaveChunk (Chunk chunk);
|
|
|
|
|
}
|
2011-04-07 08:04:53 +00:00
|
|
|
|
|
|
|
|
|
public interface IChunkManager : IChunkContainer
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
2011-04-06 04:43:54 +00:00
|
|
|
|
}
|