mirror of
https://github.com/vcmi/vcmi.git
synced 2026-06-19 22:57:37 +02:00
Integrated CClientState into GameEngine class
This commit is contained in:
+14
-4
@@ -26,8 +26,11 @@ class IScreenHandler;
|
||||
class WindowHandler;
|
||||
class EventDispatcher;
|
||||
class InputHandler;
|
||||
class ISoundPlayer;
|
||||
class IMusicPlayer;
|
||||
class CursorHandler;
|
||||
class IVideoPlayer;
|
||||
|
||||
// Handles GUI logic and drawing
|
||||
class GameEngine
|
||||
{
|
||||
private:
|
||||
@@ -46,6 +49,11 @@ private:
|
||||
std::unique_ptr<EventDispatcher> eventDispatcherInstance;
|
||||
std::unique_ptr<InputHandler> inputHandlerInstance;
|
||||
|
||||
std::unique_ptr<ISoundPlayer> soundPlayerInstance;
|
||||
std::unique_ptr<IMusicPlayer> musicPlayerInstance;
|
||||
std::unique_ptr<CursorHandler> cursorHandlerInstance;
|
||||
std::unique_ptr<IVideoPlayer> videoPlayerInstance;
|
||||
|
||||
public:
|
||||
boost::mutex interfaceMutex;
|
||||
|
||||
@@ -57,6 +65,11 @@ public:
|
||||
EventDispatcher & events();
|
||||
InputHandler & input();
|
||||
|
||||
ISoundPlayer & sound() { return *soundPlayerInstance; }
|
||||
IMusicPlayer & music() { return *musicPlayerInstance; }
|
||||
CursorHandler & cursor() { return *cursorHandlerInstance; }
|
||||
IVideoPlayer & video() { return *videoPlayerInstance; }
|
||||
|
||||
/// Returns current logical screen dimensions
|
||||
/// May not match size of window if user has UI scaling different from 100%
|
||||
Point screenDimensions() const;
|
||||
@@ -74,9 +87,6 @@ public:
|
||||
/// returns true if Shift is currently pressed down
|
||||
bool isKeyboardShiftDown() const;
|
||||
|
||||
void startTextInput(const Rect & where);
|
||||
void stopTextInput();
|
||||
|
||||
IScreenHandler & screenHandler();
|
||||
IRenderHandler & renderHandler();
|
||||
WindowHandler & windows();
|
||||
|
||||
Reference in New Issue
Block a user