summaryrefslogtreecommitdiffstats
path: root/src/Items/ItemSeeds.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/Items/ItemSeeds.h')
-rw-r--r--src/Items/ItemSeeds.h42
1 files changed, 19 insertions, 23 deletions
diff --git a/src/Items/ItemSeeds.h b/src/Items/ItemSeeds.h
index 821afb443..f9879764a 100644
--- a/src/Items/ItemSeeds.h
+++ b/src/Items/ItemSeeds.h
@@ -8,24 +8,27 @@
-class cItemSeedsHandler:
- public cItemHandler
+class cItemSeedsHandler : public cItemHandler
{
using Super = cItemHandler;
-public:
-
- constexpr cItemSeedsHandler(int a_ItemType):
+ public:
+ constexpr cItemSeedsHandler(int a_ItemType) :
Super(a_ItemType)
{
-
}
- virtual bool CommitPlacement(cPlayer & a_Player, const cItem & a_HeldItem, const Vector3i a_PlacePosition, const eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) const override
+ virtual bool CommitPlacement(
+ cPlayer & a_Player,
+ const cItem & a_HeldItem,
+ const Vector3i a_PlacePosition,
+ const eBlockFace a_ClickedBlockFace,
+ const Vector3i a_CursorPosition
+ ) const override
{
// Only allow planting seeds from the top side of the block:
if (a_ClickedBlockFace != BLOCK_FACE_TOP)
@@ -38,12 +41,12 @@ public:
// Get the produce block based on the seed item:
switch (m_ItemType)
{
- case E_ITEM_BEETROOT_SEEDS: BlockType = E_BLOCK_BEETROOTS; break;
- case E_ITEM_CARROT: BlockType = E_BLOCK_CARROTS; break;
- case E_ITEM_MELON_SEEDS: BlockType = E_BLOCK_MELON_STEM; break;
- case E_ITEM_POTATO: BlockType = E_BLOCK_POTATOES; break;
+ case E_ITEM_BEETROOT_SEEDS: BlockType = E_BLOCK_BEETROOTS; break;
+ case E_ITEM_CARROT: BlockType = E_BLOCK_CARROTS; break;
+ case E_ITEM_MELON_SEEDS: BlockType = E_BLOCK_MELON_STEM; break;
+ case E_ITEM_POTATO: BlockType = E_BLOCK_POTATOES; break;
case E_ITEM_PUMPKIN_SEEDS: BlockType = E_BLOCK_PUMPKIN_STEM; break;
- case E_ITEM_SEEDS: BlockType = E_BLOCK_CROPS; break;
+ case E_ITEM_SEEDS: BlockType = E_BLOCK_CROPS; break;
default: UNREACHABLE("Unsupported seed type");
}
@@ -54,20 +57,13 @@ public:
- virtual bool IsPlaceable(void) const override
- {
- return true;
- }
+ virtual bool IsPlaceable(void) const override { return true; }
-protected:
+ protected:
~cItemSeedsHandler() = default;
-} ;
+};
-class cItemSimpleSeedsHandler final:
- public cItemSeedsHandler
+class cItemSimpleSeedsHandler final : public cItemSeedsHandler
{
using cItemSeedsHandler::cItemSeedsHandler;
};
-
-
-