Client eventmanager refactor (#7179)
authorLoïc Blot <nerzhul@users.noreply.github.com>
Fri, 30 Mar 2018 16:32:52 +0000 (18:32 +0200)
committerGitHub <noreply@github.com>
Fri, 30 Mar 2018 16:32:52 +0000 (18:32 +0200)
commitce873108aa91d19104f46c5acd3350385e7a4541
tree58672a3c803469de71c9ae270beb9a052ba5559a
parent2c490dddc037d7d1cf211bbf28309e31b0abdadd
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
15 files changed:
src/camera.cpp
src/client.h
src/client/event_manager.h [new file with mode: 0644]
src/clientenvironment.cpp
src/event.h
src/event_manager.h [deleted file]
src/game.cpp
src/gamedef.h
src/localplayer.cpp
src/server.cpp
src/server.h
src/unittest/CMakeLists.txt
src/unittest/test.cpp
src/unittest/test_eventmanager.cpp [new file with mode: 0644]
util/travis/clang-format-whitelist.txt