1
0
Fork 0

Added a bit more documentation to cForEachChunkProvider.

This commit is contained in:
madmaxoft 2014-02-18 08:25:29 +01:00
parent 8ad4ab5bc1
commit fc8743df96
2 changed files with 33 additions and 5 deletions

View File

@ -1,14 +1,39 @@
// ForEachChunkProvider.h
// Declares the cForEachChunkProvider class which acts as an interface for classes that provide a ForEachChunkInRect() function
// Primarily serves as a decoupling between cBlockArea and cWorld
#pragma once
class cChunkDataCallback;
// fwd:
class cChunkDataCallback;
class cBlockArea;
class cForEachChunkProvider
{
public:
/** Calls the callback for each chunk in the specified range. */
virtual bool ForEachChunkInRect(int a_MinChunkX, int a_MaxChunkX, int a_MinChunkZ, int a_MaxChunkZ, cChunkDataCallback & a_Callback) = 0;
/** Writes the block area into the specified coords.
Returns true if all chunks have been processed.
a_DataTypes is a bitmask of cBlockArea::baXXX constants ORed together.
*/
virtual bool WriteBlockArea(cBlockArea & a_Area, int a_MinBlockX, int a_MinBlockY, int a_MinBlockZ, int a_DataTypes) = 0;
};

View File

@ -64,7 +64,10 @@ typedef cItemCallback<cCommandBlockEntity> cCommandBlockCallback;
// tolua_begin
class cWorld : public cForEachChunkProvider, public cWorldInterface, public cBroadcastInterface
class cWorld :
public cForEachChunkProvider,
public cWorldInterface,
public cBroadcastInterface
{
public:
@ -401,15 +404,15 @@ public:
Prefer cBlockArea::Write() instead, this is the internal implementation; cBlockArea does error checking, too.
a_DataTypes is a bitmask of cBlockArea::baXXX constants ORed together.
*/
virtual bool WriteBlockArea(cBlockArea & a_Area, int a_MinBlockX, int a_MinBlockY, int a_MinBlockZ, int a_DataTypes);
virtual bool WriteBlockArea(cBlockArea & a_Area, int a_MinBlockX, int a_MinBlockY, int a_MinBlockZ, int a_DataTypes) override;
// tolua_begin
/** Spawns item pickups for each item in the list. May compress pickups if too many entities: */
virtual void SpawnItemPickups(const cItems & a_Pickups, double a_BlockX, double a_BlockY, double a_BlockZ, double a_FlyAwaySpeed = 1.0, bool IsPlayerCreated = false);
virtual void SpawnItemPickups(const cItems & a_Pickups, double a_BlockX, double a_BlockY, double a_BlockZ, double a_FlyAwaySpeed = 1.0, bool IsPlayerCreated = false); // override; cannot specify it here due to tolua
/** Spawns item pickups for each item in the list. May compress pickups if too many entities. All pickups get the speed specified: */
virtual void SpawnItemPickups(const cItems & a_Pickups, double a_BlockX, double a_BlockY, double a_BlockZ, double a_SpeedX, double a_SpeedY, double a_SpeedZ, bool IsPlayerCreated = false);
virtual void SpawnItemPickups(const cItems & a_Pickups, double a_BlockX, double a_BlockY, double a_BlockZ, double a_SpeedX, double a_SpeedY, double a_SpeedZ, bool IsPlayerCreated = false); // override; cannot specify it here due to tolua
/** Spawns an falling block entity at the given position. It returns the UniqueID of the spawned falling block. */
int SpawnFallingBlock(int a_X, int a_Y, int a_Z, BLOCKTYPE BlockType, NIBBLETYPE BlockMeta);