diff options
author | Julian Laubstein <julianlaubstein@yahoo.de> | 2015-07-31 19:26:33 +0200 |
---|---|---|
committer | Julian Laubstein <julianlaubstein@yahoo.de> | 2015-07-31 19:26:33 +0200 |
commit | d19cde93fa3344f318fb0d4ffbf5bb0397a51a75 (patch) | |
tree | b5ee221d8a8e63c7d3b7868da1db19bf717a6ffd /src/BlockEntities | |
parent | Merge pull request #2400 from cuberite/OffloadBadChunks (diff) | |
parent | Unified the doxy-comment format. (diff) | |
download | cuberite-d19cde93fa3344f318fb0d4ffbf5bb0397a51a75.tar cuberite-d19cde93fa3344f318fb0d4ffbf5bb0397a51a75.tar.gz cuberite-d19cde93fa3344f318fb0d4ffbf5bb0397a51a75.tar.bz2 cuberite-d19cde93fa3344f318fb0d4ffbf5bb0397a51a75.tar.lz cuberite-d19cde93fa3344f318fb0d4ffbf5bb0397a51a75.tar.xz cuberite-d19cde93fa3344f318fb0d4ffbf5bb0397a51a75.tar.zst cuberite-d19cde93fa3344f318fb0d4ffbf5bb0397a51a75.zip |
Diffstat (limited to 'src/BlockEntities')
-rw-r--r-- | src/BlockEntities/BlockEntity.h | 17 | ||||
-rw-r--r-- | src/BlockEntities/BlockEntityWithItems.h | 4 | ||||
-rw-r--r-- | src/BlockEntities/CommandBlockEntity.h | 16 | ||||
-rw-r--r-- | src/BlockEntities/DropSpenserEntity.h | 12 | ||||
-rw-r--r-- | src/BlockEntities/DropperEntity.h | 5 | ||||
-rw-r--r-- | src/BlockEntities/HopperEntity.cpp | 16 | ||||
-rw-r--r-- | src/BlockEntities/HopperEntity.h | 29 | ||||
-rw-r--r-- | src/BlockEntities/NoteEntity.h | 2 | ||||
-rw-r--r-- | src/BlockEntities/SignEntity.h | 8 |
9 files changed, 49 insertions, 60 deletions
diff --git a/src/BlockEntities/BlockEntity.h b/src/BlockEntities/BlockEntity.h index 785ee978a..f1c470ec3 100644 --- a/src/BlockEntities/BlockEntity.h +++ b/src/BlockEntities/BlockEntity.h @@ -63,9 +63,9 @@ public: m_World = a_World; } - /// Creates a new block entity for the specified block type - /// If a_World is valid, then the entity is created bound to that world - /// Returns nullptr for unknown block types + /** Creates a new block entity for the specified block type + If a_World is valid, then the entity is created bound to that world + Returns nullptr for unknown block types. */ static cBlockEntity * CreateByBlockType(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, int a_BlockX, int a_BlockY, int a_BlockZ, cWorld * a_World = nullptr); static const char * GetClassStatic(void) // Needed for ManualBindings's ForEach templates @@ -102,15 +102,14 @@ public: // tolua_end - /// Called when a player uses this entity; should open the UI window + /** Called when a player uses this entity; should open the UI window */ virtual void UsedBy( cPlayer * a_Player) = 0; /** Sends the packet defining the block entity to the client specified. - To send to all eligible clients, use cWorld::BroadcastBlockEntity() - */ + To send to all eligible clients, use cWorld::BroadcastBlockEntity() */ virtual void SendTo(cClientHandle & a_Client) = 0; - /// Ticks the entity; returns true if the chunk should be marked as dirty as a result of this ticking. By default does nothing. + /** Ticks the entity; returns true if the chunk should be marked as dirty as a result of this ticking. By default does nothing. */ virtual bool Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) { UNUSED(a_Dt); @@ -118,10 +117,10 @@ public: } protected: - /// Position in absolute block coordinates + /** Position in absolute block coordinates */ int m_PosX, m_PosY, m_PosZ; - /// Position relative to the chunk, used to speed up ticking + /** Position relative to the chunk, used to speed up ticking */ int m_RelX, m_RelZ; BLOCKTYPE m_BlockType; diff --git a/src/BlockEntities/BlockEntityWithItems.h b/src/BlockEntities/BlockEntityWithItems.h index 30a09bc02..3810f4f04 100644 --- a/src/BlockEntities/BlockEntityWithItems.h +++ b/src/BlockEntities/BlockEntityWithItems.h @@ -64,12 +64,12 @@ public: void SetSlot(int a_SlotNum, const cItem & a_Item) { m_Contents.SetSlot(a_SlotNum, a_Item); } void SetSlot(int a_X, int a_Y, const cItem & a_Item) { m_Contents.SetSlot(a_X, a_Y, a_Item); } - /// Returns the ItemGrid used for storing the contents + /** Returns the ItemGrid used for storing the contents */ cItemGrid & GetContents(void) { return m_Contents; } // tolua_end - /// Const version of the GetContents() function for C++ type-safety + /** Const version of the GetContents() function for C++ type-safety */ const cItemGrid & GetContents(void) const { return m_Contents; } protected: diff --git a/src/BlockEntities/CommandBlockEntity.h b/src/BlockEntities/CommandBlockEntity.h index c525ebc26..959a40681 100644 --- a/src/BlockEntities/CommandBlockEntity.h +++ b/src/BlockEntities/CommandBlockEntity.h @@ -30,7 +30,7 @@ public: BLOCKENTITY_PROTODEF(cCommandBlockEntity) - /// Creates a new empty command block entity + /** Creates a new empty command block entity */ cCommandBlockEntity(int a_X, int a_Y, int a_Z, cWorld * a_World); virtual bool Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override; @@ -43,29 +43,29 @@ public: // tolua_begin - /// Sets the internal redstone power flag to "on" or "off", depending on the parameter. Calls Activate() if appropriate + /** Sets the internal redstone power flag to "on" or "off", depending on the parameter. Calls Activate() if appropriate */ virtual void SetRedstonePower(bool a_IsPowered) override; - /// Sets the command block to execute a command in the next tick + /** Sets the command block to execute a command in the next tick */ void Activate(void); - /// Sets the command + /** Sets the command */ void SetCommand(const AString & a_Cmd); - /// Retrieves stored command + /** Retrieves stored command */ const AString & GetCommand(void) const; - /// Retrieves the last line of output generated by the command block + /** Retrieves the last line of output generated by the command block */ const AString & GetLastOutput(void) const; - /// Retrieves the result (signal strength) of the last operation + /** Retrieves the result (signal strength) of the last operation */ NIBBLETYPE GetResult(void) const; // tolua_end private: - /// Executes the associated command + /** Executes the associated command */ void Execute(); bool m_ShouldExecute; diff --git a/src/BlockEntities/DropSpenserEntity.h b/src/BlockEntities/DropSpenserEntity.h index 83500addb..5cdb59b28 100644 --- a/src/BlockEntities/DropSpenserEntity.h +++ b/src/BlockEntities/DropSpenserEntity.h @@ -53,28 +53,28 @@ public: // tolua_begin - /// Modifies the block coords to match the dropspenser direction given (where the dropspensed pickups should materialize) + /** Modifies the block coords to match the dropspenser direction given (where the dropspensed pickups should materialize) */ void AddDropSpenserDir(int & a_BlockX, int & a_BlockY, int & a_BlockZ, NIBBLETYPE a_Direction); - /// Sets the dropspenser to dropspense an item in the next tick + /** Sets the dropspenser to dropspense an item in the next tick */ void Activate(void); // tolua_end - /// Sets the internal redstone power flag to "on" or "off", depending on the parameter. Calls Activate() if appropriate + /** Sets the internal redstone power flag to "on" or "off", depending on the parameter. Calls Activate() if appropriate */ virtual void SetRedstonePower(bool a_IsPowered) override; protected: bool m_ShouldDropSpense; ///< If true, the dropspenser will dropspense an item in the next tick bool m_IsPowered; ///< Set to true when the dropspenser receives redstone power. - /// Does the actual work on dropspensing an item. Chooses the slot, calls DropSpenseFromSlot() and handles smoke / sound effects + /** Does the actual work on dropspensing an item. Chooses the slot, calls DropSpenseFromSlot() and handles smoke / sound effects */ void DropSpense(cChunk & a_Chunk); - /// Override this function to provide the specific behavior for item dropspensing (drop / shoot / pour / ...) + /** Override this function to provide the specific behavior for item dropspensing (drop / shoot / pour / ...) */ virtual void DropSpenseFromSlot(cChunk & a_Chunk, int a_SlotNum) = 0; - /// Helper function, drops one item from the specified slot (like a dropper) + /** Helper function, drops one item from the specified slot (like a dropper) */ void DropFromSlot(cChunk & a_Chunk, int a_SlotNum); } ; // tolua_export diff --git a/src/BlockEntities/DropperEntity.h b/src/BlockEntities/DropperEntity.h index c638dafa8..1ca396eb7 100644 --- a/src/BlockEntities/DropperEntity.h +++ b/src/BlockEntities/DropperEntity.h @@ -27,7 +27,7 @@ public: BLOCKENTITY_PROTODEF(cDropperEntity) - /// Constructor used for normal operation + /** Constructor used for normal operation */ cDropperEntity(int a_BlockX, int a_BlockY, int a_BlockZ, cWorld * a_World); protected: @@ -36,8 +36,7 @@ protected: /** Takes an item from slot a_SlotNum and puts it into the container in front of the dropper. Called when there's a container directly in front of the dropper, - so the dropper should store items there, rather than dropping. - */ + so the dropper should store items there, rather than dropping. */ void PutIntoContainer(cChunk & a_Chunk, int a_SlotNum, BLOCKTYPE a_ContainerBlock, int a_ContainerX, int a_ContainerY, int a_ContainerZ); } ; // tolua_export diff --git a/src/BlockEntities/HopperEntity.cpp b/src/BlockEntities/HopperEntity.cpp index 662212c4d..33ca974d5 100644 --- a/src/BlockEntities/HopperEntity.cpp +++ b/src/BlockEntities/HopperEntity.cpp @@ -28,9 +28,6 @@ cHopperEntity::cHopperEntity(int a_BlockX, int a_BlockY, int a_BlockZ, cWorld * -/** Returns the block coords of the block receiving the output items, based on the meta -Returns false if unattached -*/ bool cHopperEntity::GetOutputBlockPos(NIBBLETYPE a_BlockMeta, int & a_OutputX, int & a_OutputY, int & a_OutputZ) { a_OutputX = m_PosX; @@ -115,7 +112,6 @@ void cHopperEntity::UsedBy(cPlayer * a_Player) -/// Opens a new window UI for this hopper void cHopperEntity::OpenNewWindow(void) { OpenWindow(new cHopperWindow(m_PosX, m_PosY, m_PosZ, this)); @@ -125,7 +121,6 @@ void cHopperEntity::OpenNewWindow(void) -/// Moves items from the container above it into this hopper. Returns true if the contents have changed. bool cHopperEntity::MoveItemsIn(cChunk & a_Chunk, Int64 a_CurrentTick) { if (m_PosY >= cChunkDef::Height) @@ -180,7 +175,6 @@ bool cHopperEntity::MoveItemsIn(cChunk & a_Chunk, Int64 a_CurrentTick) -/// Moves pickups from above this hopper into it. Returns true if the contents have changed. bool cHopperEntity::MovePickupsIn(cChunk & a_Chunk, Int64 a_CurrentTick) { UNUSED(a_CurrentTick); @@ -273,7 +267,6 @@ bool cHopperEntity::MovePickupsIn(cChunk & a_Chunk, Int64 a_CurrentTick) -/// Moves items out from this hopper into the destination. Returns true if the contents have changed. bool cHopperEntity::MoveItemsOut(cChunk & a_Chunk, Int64 a_CurrentTick) { if (a_CurrentTick - m_LastMoveItemsOutTick < TICKS_PER_TRANSFER) @@ -352,7 +345,6 @@ bool cHopperEntity::MoveItemsOut(cChunk & a_Chunk, Int64 a_CurrentTick) -/// Moves items from a chest (dblchest) above the hopper into this hopper. Returns true if contents have changed. bool cHopperEntity::MoveItemsFromChest(cChunk & a_Chunk) { cChestEntity * MainChest = static_cast<cChestEntity *>(a_Chunk.GetBlockEntity(m_PosX, m_PosY + 1, m_PosZ)); @@ -419,7 +411,6 @@ bool cHopperEntity::MoveItemsFromChest(cChunk & a_Chunk) -/// Moves items from a furnace above the hopper into this hopper. Returns true if contents have changed. bool cHopperEntity::MoveItemsFromFurnace(cChunk & a_Chunk) { cFurnaceEntity * Furnace = static_cast<cFurnaceEntity *>(a_Chunk.GetBlockEntity(m_PosX, m_PosY + 1, m_PosZ)); @@ -479,7 +470,6 @@ bool cHopperEntity::MoveItemsFromGrid(cBlockEntityWithItems & a_Entity) -/// Moves one piece of the specified a_Entity's slot itemstack into this hopper. Returns true if contents have changed. Doesn't change the itemstack. bool cHopperEntity::MoveItemsFromSlot(cBlockEntityWithItems & a_Entity, int a_SlotNum) { cItem One(a_Entity.GetSlot(a_SlotNum).CopyOne()); @@ -521,7 +511,6 @@ bool cHopperEntity::MoveItemsFromSlot(cBlockEntityWithItems & a_Entity, int a_Sl -/// Moves items to the chest at the specified coords. Returns true if contents have changed bool cHopperEntity::MoveItemsToChest(cChunk & a_Chunk, int a_BlockX, int a_BlockY, int a_BlockZ) { // Try the chest directly connected to the hopper: @@ -589,7 +578,6 @@ bool cHopperEntity::MoveItemsToChest(cChunk & a_Chunk, int a_BlockX, int a_Block -/// Moves items to the furnace at the specified coords. Returns true if contents have changed bool cHopperEntity::MoveItemsToFurnace(cChunk & a_Chunk, int a_BlockX, int a_BlockY, int a_BlockZ, NIBBLETYPE a_HopperMeta) { cFurnaceEntity * Furnace = static_cast<cFurnaceEntity *>(a_Chunk.GetBlockEntity(a_BlockX, a_BlockY, a_BlockZ)); @@ -674,3 +662,7 @@ bool cHopperEntity::MoveItemsToSlot(cBlockEntityWithItems & a_Entity, int a_DstS return false; } } + + + + diff --git a/src/BlockEntities/HopperEntity.h b/src/BlockEntities/HopperEntity.h index 16d4cb6f9..ba0fe28f3 100644 --- a/src/BlockEntities/HopperEntity.h +++ b/src/BlockEntities/HopperEntity.h @@ -33,13 +33,12 @@ public: BLOCKENTITY_PROTODEF(cHopperEntity) - /// Constructor used for normal operation + /** Constructor used for normal operation */ cHopperEntity(int a_BlockX, int a_BlockY, int a_BlockZ, cWorld * a_World); /** Returns the block coords of the block receiving the output items, based on the meta Returns false if unattached. - Exported in ManualBindings.cpp - */ + Exported in ManualBindings.cpp. */ bool GetOutputBlockPos(NIBBLETYPE a_BlockMeta, int & a_OutputX, int & a_OutputY, int & a_OutputZ); protected: @@ -52,40 +51,40 @@ protected: virtual void SendTo(cClientHandle & a_Client) override; virtual void UsedBy(cPlayer * a_Player) override; - /// Opens a new chest window for this chest. Scans for neighbors to open a double chest window, if appropriate. + /** Opens a new chest window for this chest. Scans for neighbors to open a double chest window, if appropriate. */ void OpenNewWindow(void); - /// Moves items from the container above it into this hopper. Returns true if the contents have changed. + /** Moves items from the container above it into this hopper. Returns true if the contents have changed. */ bool MoveItemsIn(cChunk & a_Chunk, Int64 a_CurrentTick); - /// Moves pickups from above this hopper into it. Returns true if the contents have changed. + /** Moves pickups from above this hopper into it. Returns true if the contents have changed. */ bool MovePickupsIn(cChunk & a_Chunk, Int64 a_CurrentTick); - /// Moves items out from this hopper into the destination. Returns true if the contents have changed. + /** Moves items out from this hopper into the destination. Returns true if the contents have changed. */ bool MoveItemsOut(cChunk & a_Chunk, Int64 a_CurrentTick); - /// Moves items from a chest (dblchest) above the hopper into this hopper. Returns true if contents have changed. + /** Moves items from a chest (dblchest) above the hopper into this hopper. Returns true if contents have changed. */ bool MoveItemsFromChest(cChunk & a_Chunk); - /// Moves items from a furnace above the hopper into this hopper. Returns true if contents have changed. + /** Moves items from a furnace above the hopper into this hopper. Returns true if contents have changed. */ bool MoveItemsFromFurnace(cChunk & a_Chunk); - /// Moves items from the specified a_Entity's Contents into this hopper. Returns true if contents have changed. + /** Moves items from the specified a_Entity's Contents into this hopper. Returns true if contents have changed. */ bool MoveItemsFromGrid(cBlockEntityWithItems & a_Entity); - /// Moves one piece from the specified itemstack into this hopper. Returns true if contents have changed. Doesn't change the itemstack. + /** Moves one piece from the specified itemstack into this hopper. Returns true if contents have changed. Doesn't change the itemstack. */ bool MoveItemsFromSlot(cBlockEntityWithItems & a_Entity, int a_SrcSlotNum); - /// Moves items to the chest at the specified coords. Returns true if contents have changed + /** Moves items to the chest at the specified coords. Returns true if contents have changed */ bool MoveItemsToChest(cChunk & a_Chunk, int a_BlockX, int a_BlockY, int a_BlockZ); - /// Moves items to the furnace at the specified coords. Returns true if contents have changed + /** Moves items to the furnace at the specified coords. Returns true if contents have changed */ bool MoveItemsToFurnace(cChunk & a_Chunk, int a_BlockX, int a_BlockY, int a_BlockZ, NIBBLETYPE a_HopperMeta); - /// Moves items to the specified ItemGrid. Returns true if contents have changed + /** Moves items to the specified ItemGrid. Returns true if contents have changed */ bool MoveItemsToGrid(cBlockEntityWithItems & a_Entity); - /// Moves one piece to the specified entity's contents' slot. Returns true if contents have changed. + /** Moves one piece to the specified entity's contents' slot. Returns true if contents have changed. */ bool MoveItemsToSlot(cBlockEntityWithItems & a_Entity, int a_DstSlotNum); } ; // tolua_export diff --git a/src/BlockEntities/NoteEntity.h b/src/BlockEntities/NoteEntity.h index f350ef4c4..eb2e23fa2 100644 --- a/src/BlockEntities/NoteEntity.h +++ b/src/BlockEntities/NoteEntity.h @@ -36,7 +36,7 @@ public: BLOCKENTITY_PROTODEF(cNoteEntity) - /// Creates a new note entity. a_World may be nullptr + /** Creates a new note entity. a_World may be nullptr */ cNoteEntity(int a_X, int a_Y, int a_Z, cWorld * a_World); virtual ~cNoteEntity() {} diff --git a/src/BlockEntities/SignEntity.h b/src/BlockEntities/SignEntity.h index 9480537ed..373f5e294 100644 --- a/src/BlockEntities/SignEntity.h +++ b/src/BlockEntities/SignEntity.h @@ -27,18 +27,18 @@ public: BLOCKENTITY_PROTODEF(cSignEntity) - /// Creates a new empty sign entity at the specified block coords and block type (wall or standing). a_World may be nullptr + /** Creates a new empty sign entity at the specified block coords and block type (wall or standing). a_World may be nullptr */ cSignEntity(BLOCKTYPE a_BlockType, int a_X, int a_Y, int a_Z, cWorld * a_World); // tolua_begin - /// Sets all the sign's lines + /** Sets all the sign's lines */ void SetLines(const AString & a_Line1, const AString & a_Line2, const AString & a_Line3, const AString & a_Line4); - /// Sets individual line (zero-based index) + /** Sets individual line (zero-based index) */ void SetLine(int a_Index, const AString & a_Line); - /// Retrieves individual line (zero-based index) + /** Retrieves individual line (zero-based index) */ AString GetLine(int a_Index) const; // tolua_end |