Luanti 5.10.0-dev
 
Loading...
Searching...
No Matches
dummygamedef.h
Go to the documentation of this file.
1// Luanti
2// SPDX-License-Identifier: LGPL-2.1-or-later
3// Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
4// Copyright (C) 2022 TurkeyMcMac, Jude Melton-Houghton <jwmhjwmh@gmail.com>
5
6#pragma once
7
8#include "gamedef.h"
9#include "itemdef.h"
10#include "nodedef.h"
11#include "craftdef.h"
12#include "content/mods.h"
14
15class DummyGameDef : public IGameDef {
16public:
24
26 {
28 delete m_craftdef;
29 delete m_nodedef;
30 delete m_itemdef;
31 }
32
34 const NodeDefManager *getNodeDefManager() override { return m_nodedef; }
37
38 u16 allocateUnknownNodeId(const std::string &name) override
39 {
40 return m_nodedef->allocateDummy(name);
41 }
42
43 const std::vector<ModSpec> &getMods() const override
44 {
45 static std::vector<ModSpec> emptymodspec;
46 return emptymodspec;
47 }
48 const ModSpec* getModSpec(const std::string &modname) const override { return nullptr; }
50
51 bool joinModChannel(const std::string &channel) override { return false; }
52 bool leaveModChannel(const std::string &channel) override { return false; }
53 bool sendModChannelMessage(const std::string &channel, const std::string &message) override
54 {
55 return false;
56 }
57 ModChannel *getModChannel(const std::string &channel) override { return nullptr; }
58
59protected:
64};
Definition database-dummy.h:14
Definition dummygamedef.h:15
u16 allocateUnknownNodeId(const std::string &name) override
Definition dummygamedef.h:38
const ModSpec * getModSpec(const std::string &modname) const override
Definition dummygamedef.h:48
ICraftDefManager * m_craftdef
Definition dummygamedef.h:62
~DummyGameDef()
Definition dummygamedef.h:25
NodeDefManager * getWritableNodeDefManager()
Definition dummygamedef.h:35
ModStorageDatabase * getModStorageDatabase() override
Definition dummygamedef.h:49
ModStorageDatabase * m_mod_storage_database
Definition dummygamedef.h:63
const std::vector< ModSpec > & getMods() const override
Definition dummygamedef.h:43
DummyGameDef()
Definition dummygamedef.h:17
bool leaveModChannel(const std::string &channel) override
Definition dummygamedef.h:52
ICraftDefManager * getCraftDefManager() override
Definition dummygamedef.h:36
ModChannel * getModChannel(const std::string &channel) override
Definition dummygamedef.h:57
bool joinModChannel(const std::string &channel) override
Definition dummygamedef.h:51
NodeDefManager * m_nodedef
Definition dummygamedef.h:61
const NodeDefManager * getNodeDefManager() override
Definition dummygamedef.h:34
bool sendModChannelMessage(const std::string &channel, const std::string &message) override
Definition dummygamedef.h:53
IItemDefManager * getItemDefManager() override
Definition dummygamedef.h:33
IItemDefManager * m_itemdef
Definition dummygamedef.h:60
Definition craftdef.h:390
Definition gamedef.h:36
Definition itemdef.h:129
Definition modchannels.h:23
Definition database.h:74
This class is for getting the actual properties of nodes from their content ID.
Definition nodedef.h:541
content_t allocateDummy(const std::string &name)
Definition nodedef.cpp:1365
IWritableCraftDefManager * createCraftDefManager()
Definition craftdef.cpp:1241
IWritableItemDefManager * createItemDefManager()
Definition itemdef.cpp:677
NodeDefManager * createNodeDefManager()
Definition nodedef.cpp:1583
Definition mods.h:25