]> git.lizzy.rs Git - minetest.git/blobdiff - src/inventorymanager.h
Lua_api.txt: Add documentation for 'eye_height' player object property
[minetest.git] / src / inventorymanager.h
index 916b3ea31f36fc83d8cc03afa27e02dd3c301436..9ae92e5f4ba2c1922d4d1fdb269d1c4f96347e57 100644 (file)
@@ -17,8 +17,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */
 
-#ifndef INVENTORYMANAGER_HEADER
-#define INVENTORYMANAGER_HEADER
+#pragma once
 
 #include "inventory.h"
 #include <iostream>
@@ -55,7 +54,7 @@ struct InventoryLocation
                type = PLAYER;
                name = name_;
        }
-       void setNodeMeta(v3s16 p_)
+       void setNodeMeta(const v3s16 &p_)
        {
                type = NODEMETA;
                p = p_;
@@ -106,8 +105,8 @@ struct InventoryAction;
 class InventoryManager
 {
 public:
-       InventoryManager(){}
-       virtual ~InventoryManager(){}
+       InventoryManager() = default;
+       virtual ~InventoryManager() = default;
 
        // Get an inventory (server and client)
        virtual Inventory* getInventory(const InventoryLocation &loc){return NULL;}
@@ -132,7 +131,7 @@ struct InventoryAction
        virtual void apply(InventoryManager *mgr, ServerActiveObject *player,
                        IGameDef *gamedef) = 0;
        virtual void clientApply(InventoryManager *mgr, IGameDef *gamedef) = 0;
-       virtual ~InventoryAction() {};
+       virtual ~InventoryAction() = default;;
 };
 
 struct IMoveAction : public InventoryAction
@@ -152,7 +151,7 @@ struct IMoveAction : public InventoryAction
        bool caused_by_move_somewhere = false;
        u32 move_count = 0;
 
-       IMoveAction() {}
+       IMoveAction() = default;
 
        IMoveAction(std::istream &is, bool somewhere);
 
@@ -190,7 +189,7 @@ struct IDropAction : public InventoryAction
        std::string from_list;
        s16 from_i = -1;
 
-       IDropAction() {}
+       IDropAction() = default;
 
        IDropAction(std::istream &is);
 
@@ -219,7 +218,7 @@ struct ICraftAction : public InventoryAction
        u16 count = 0;
        InventoryLocation craft_inv;
 
-       ICraftAction() {}
+       ICraftAction() = default;
 
        ICraftAction(std::istream &is);
 
@@ -244,6 +243,3 @@ struct ICraftAction : public InventoryAction
 bool getCraftingResult(Inventory *inv, ItemStack &result,
                std::vector<ItemStack> &output_replacements,
                bool decrementInput, IGameDef *gamedef);
-
-#endif
-