3 Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation; either version 2.1 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 #include "irrlichttypes.h"
26 class IItemDefManager;
28 class ICraftDefManager;
31 class IRollbackManager;
36 class ModMetadataDatabase;
38 namespace irr { namespace scene {
45 An interface for fetching game-global definitions like tool and
52 // These are thread-safe IF they are not edited while running threads.
53 // Thus, first they are set up and then they are only read.
54 virtual IItemDefManager* getItemDefManager()=0;
55 virtual const NodeDefManager* getNodeDefManager()=0;
56 virtual ICraftDefManager* getCraftDefManager()=0;
58 // Used for keeping track of names/ids of unknown nodes
59 virtual u16 allocateUnknownNodeId(const std::string &name)=0;
61 // Only usable on the server, and NOT thread-safe. It is usable from the
62 // environment thread.
63 virtual IRollbackManager* getRollbackManager() { return NULL; }
66 IItemDefManager *idef() { return getItemDefManager(); }
67 const NodeDefManager *ndef() { return getNodeDefManager(); }
68 ICraftDefManager *cdef() { return getCraftDefManager(); }
69 IRollbackManager *rollback() { return getRollbackManager(); }
71 virtual const std::vector<ModSpec> &getMods() const = 0;
72 virtual const ModSpec* getModSpec(const std::string &modname) const = 0;
73 virtual std::string getWorldPath() const { return ""; }
74 virtual bool registerModStorage(ModMetadata *storage) = 0;
75 virtual void unregisterModStorage(const std::string &name) = 0;
76 virtual ModMetadataDatabase *getModStorageDatabase() = 0;
78 virtual bool joinModChannel(const std::string &channel) = 0;
79 virtual bool leaveModChannel(const std::string &channel) = 0;
80 virtual bool sendModChannelMessage(const std::string &channel,
81 const std::string &message) = 0;
82 virtual ModChannel *getModChannel(const std::string &channel) = 0;