mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-02 16:38:41 +00:00
Client eventmanager refactor (#7179)
* Drop EventManager from GameDef & do some client cleanups * EventManager is only used by Client. Don't expose it on Server & GameDef for nothing * Drop Client::event() in favor of direct calls to getEventManager * Cleanup some event put from new + put to put(new) * MtEvent: add Type(u8) enum * This will enhance event performance & ensure stricter type * Drop MtEvent::checkIs (unused) * clang-tidy reported fixes * Code style * Move event_manager.h to the client directory as it's only used by client Add EventManager unittests + switch to unordered_map as order is not important here Drop a unused function
This commit is contained in:
parent
2c490dddc0
commit
ce873108aa
15 changed files with 249 additions and 185 deletions
|
@ -28,7 +28,6 @@ class NodeDefManager;
|
|||
class ICraftDefManager;
|
||||
class ITextureSource;
|
||||
class IShaderSource;
|
||||
class MtEventManager;
|
||||
class IRollbackManager;
|
||||
class EmergeManager;
|
||||
class Camera;
|
||||
|
@ -58,8 +57,6 @@ public:
|
|||
// Used for keeping track of names/ids of unknown nodes
|
||||
virtual u16 allocateUnknownNodeId(const std::string &name)=0;
|
||||
|
||||
virtual MtEventManager* getEventManager()=0;
|
||||
|
||||
// Only usable on the server, and NOT thread-safe. It is usable from the
|
||||
// environment thread.
|
||||
virtual IRollbackManager* getRollbackManager() { return NULL; }
|
||||
|
@ -68,8 +65,6 @@ public:
|
|||
IItemDefManager *idef() { return getItemDefManager(); }
|
||||
const NodeDefManager *ndef() { return getNodeDefManager(); }
|
||||
ICraftDefManager *cdef() { return getCraftDefManager(); }
|
||||
|
||||
MtEventManager *event() { return getEventManager(); }
|
||||
IRollbackManager *rollback() { return getRollbackManager(); }
|
||||
|
||||
virtual const std::vector<ModSpec> &getMods() const = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue