summaryrefslogtreecommitdiff
path: root/src/inventorymanager.h
diff options
context:
space:
mode:
authorLoic Blot <loic.blot@unix-experience.fr>2017-08-18 08:07:59 +0200
committerLoic Blot <loic.blot@unix-experience.fr>2017-08-18 08:07:59 +0200
commit1d086aee7cc193bed2f8ca09cc2e020f509378f1 (patch)
tree106347a80cefc8b4f9d884e669a573da653d4178 /src/inventorymanager.h
parent55ab4264dc3f42a4588de0cf52e8f0f88e4fd90e (diff)
downloadminetest-1d086aee7cc193bed2f8ca09cc2e020f509378f1.tar.gz
minetest-1d086aee7cc193bed2f8ca09cc2e020f509378f1.tar.bz2
minetest-1d086aee7cc193bed2f8ca09cc2e020f509378f1.zip
Modernize various files (part 2)
* range-based for loops * emplace_back instead of push_back * code style * C++ headers instead of C headers * Default operators * empty stl function
Diffstat (limited to 'src/inventorymanager.h')
-rw-r--r--src/inventorymanager.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/inventorymanager.h b/src/inventorymanager.h
index 53830d5c1..9ae92e5f4 100644
--- a/src/inventorymanager.h
+++ b/src/inventorymanager.h
@@ -54,7 +54,7 @@ struct InventoryLocation
type = PLAYER;
name = name_;
}
- void setNodeMeta(v3s16 p_)
+ void setNodeMeta(const v3s16 &p_)
{
type = NODEMETA;
p = p_;
@@ -105,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;}
@@ -131,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
@@ -151,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);
@@ -189,7 +189,7 @@ struct IDropAction : public InventoryAction
std::string from_list;
s16 from_i = -1;
- IDropAction() {}
+ IDropAction() = default;
IDropAction(std::istream &is);
@@ -218,7 +218,7 @@ struct ICraftAction : public InventoryAction
u16 count = 0;
InventoryLocation craft_inv;
- ICraftAction() {}
+ ICraftAction() = default;
ICraftAction(std::istream &is);