From 15b92af166e03e3deb8baf5eb2ec6b0be5981646 Mon Sep 17 00:00:00 2001 From: Tycho Date: Sat, 25 Jan 2014 11:14:14 -0800 Subject: First attempt at Implementing Interfaces --- src/Blocks/ChunkInterface.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/Blocks/ChunkInterface.h (limited to 'src/Blocks/ChunkInterface.h') diff --git a/src/Blocks/ChunkInterface.h b/src/Blocks/ChunkInterface.h new file mode 100644 index 000000000..91a635dcf --- /dev/null +++ b/src/Blocks/ChunkInterface.h @@ -0,0 +1,26 @@ + +#pragma once + +class cChunkInterface +{ +public: + + BLOCKTYPE GetBlock (int a_BlockX, int a_BlockY, int a_BlockZ); + BLOCKTYPE GetBlock (const Vector3i & a_Pos ) { return GetBlock( a_Pos.x, a_Pos.y, a_Pos.z ); } + NIBBLETYPE GetBlockMeta (int a_BlockX, int a_BlockY, int a_BlockZ); + + /** Sets the block at the specified coords to the specified value. + Full processing, incl. updating neighbors, is performed. + */ + void SetBlock(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta); + + + /** Sets the block at the specified coords to the specified value. + The replacement doesn't trigger block updates. + The replaced blocks aren't checked for block entities (block entity is leaked if it exists at this block) + */ + void FastSetBlock(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta); + void FastSetBlock(const Vector3i & a_Pos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta ) { FastSetBlock( a_Pos.x, a_Pos.y, a_Pos.z, a_BlockType, a_BlockMeta ); } + + void DoExplosionAt(double a_ExplosionSize, double a_BlockX, double a_BlockY, double a_BlockZ, bool a_CanCauseFire, eExplosionSource a_Source, void * a_SourceData); +}; -- cgit v1.2.3