From 44aeea0f22092b7b9e7df1bd5c1fb7b93bb3524e Mon Sep 17 00:00:00 2001 From: tetektoza Date: Sat, 14 Oct 2023 18:40:01 +0200 Subject: [PATCH] Items: Add isGold() function to items.h This patch adds isGold() function to items.h, which checks if the item's type is gold. --- Source/items.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Source/items.h b/Source/items.h index d1d688c15..a090ee5f3 100644 --- a/Source/items.h +++ b/Source/items.h @@ -333,6 +333,15 @@ struct Item { } } + /** + * @brief Checks whether this item is gold. + * @return 'True' in case the item is gold and 'False' otherwise. + */ + bool isGold() const + { + return this->_itype == ItemType::Gold; + } + /** * @brief Checks whether this item is a helm. * @return 'True' in case the item is a helm and 'False' otherwise.