Luanti 5.15.0-dev
 
Loading...
Searching...
No Matches
mock_inventorymanager.h
Go to the documentation of this file.
1// Luanti
2// SPDX-License-Identifier: LGPL-2.1-or-later
3// Copyright (C) 2022 Minetest core developers & community
4
5#pragma once
6
7#include "gamedef.h"
8#include "inventory.h"
10
11
13{
14public:
16 p1(gamedef->getItemDefManager()),
17 p2(gamedef->getItemDefManager())
18 {};
19
21 {
22 if (loc.type == InventoryLocation::PLAYER && loc.name == "p1")
23 return &p1;
24 if (loc.type == InventoryLocation::PLAYER && loc.name == "p2")
25 return &p2;
26 return nullptr;
27 }
28 void setInventoryModified(const InventoryLocation &loc) override {}
29
32
33};
Definition gamedef.h:26
Definition inventory.h:277
Definition mock_inventorymanager.h:13
Inventory p2
Definition mock_inventorymanager.h:31
void setInventoryModified(const InventoryLocation &loc) override
Definition mock_inventorymanager.h:28
Inventory p1
Definition mock_inventorymanager.h:30
MockInventoryManager(IGameDef *gamedef)
Definition mock_inventorymanager.h:15
Inventory * getInventory(const InventoryLocation &loc) override
Definition mock_inventorymanager.h:20
Definition serverinventorymgr.h:17
Definition inventorymanager.h:18
enum InventoryLocation::Type type
std::string name
Definition inventorymanager.h:27
@ PLAYER
Definition inventorymanager.h:22