From e8366993ce3f1cc0c2c6cde1d133773d1f23c474 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Mon, 6 Aug 2012 20:10:16 +0000 Subject: A bit of cleanup and documentation around the UI window handling git-svn-id: http://mc-server.googlecode.com/svn/trunk@716 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/blocks/Block.h | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) (limited to 'source/blocks/Block.h') diff --git a/source/blocks/Block.h b/source/blocks/Block.h index 0a5724ca3..50c541551 100644 --- a/source/blocks/Block.h +++ b/source/blocks/Block.h @@ -27,21 +27,30 @@ public: virtual NIBBLETYPE GetDropMeta(NIBBLETYPE a_BlockMeta); virtual bool NeedsRandomTicks(); virtual void DropBlock(cWorld *a_World, int a_X, int a_Y, int a_Z); - //Checks if the block can stay at - virtual bool CanBeAt(cWorld *a_World, int a_X, int a_Y, int a_Z); - //Checks if the block can be placed at this point. Default: CanBeAt(...) NOTE: In the block is not placed in this callback - virtual bool CanBePlacedAt(cWorld *a_World, int a_X, int a_Y, int a_Z, char a_Dir); - //This gets called if the player tries to place a block ontop of this block (Only if he aims directly on this block) - virtual bool AllowBlockOnTop(); - virtual bool IsUseable(); - virtual bool IsClickedThrough(); - virtual bool IgnoreBuildCollision(); - //Indicates this block can be placed on the side of other blocks. Default: true + + /// Checks if the block can stay at the specified coords in the + virtual bool CanBeAt(cWorld *a_World, int a_BlockX, int a_BlockY, int a_BlockZ); + + /// Checks if the block can be placed at this point. Default: CanBeAt(...) NOTE: This call doesn't actually place the block + virtual bool CanBePlacedAt(cWorld * a_World, int a_BlockX, int a_BlockY, int a_BlockZ, char a_Dir); + + /// Called when the player tries to place a block on top of this block (Only if he aims directly on this block); return false to disallow + virtual bool AllowBlockOnTop(void); + + /// Called to check whether this block supports a rclk action. If it returns true, OnClicked() is called + virtual bool IsUseable(void); + + virtual bool IsClickedThrough(void); + + virtual bool IgnoreBuildCollision(void); + + /// Indicates this block can be placed on the side of other blocks. Default: true virtual bool CanBePlacedOnSide(); - //Does this block drops if it gets destroyed by an unsuitable situation? Default: true + + /// Does this block drop if it gets destroyed by an unsuitable situation? Default: true virtual bool DropOnUnsuitable(); - static cBlockHandler *GetBlockHandler(BLOCKTYPE a_BlockID); + static cBlockHandler * GetBlockHandler(BLOCKTYPE a_BlockID); static void Deinit(); -- cgit v1.2.3