1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- #ifndef CLIENT_H
- #define CLIENT_H
- #include "../engine/Wrapper.h"
- #include "../engine/KeyManager.h"
- #include "../engine/MouseManager.h"
- #include "../engine/Clock.h"
- #include "../engine/Shader.h"
- #include "../engine/DirectRenderer.h"
- #include "../world/Chunk.h"
- using namespace std;
- class Client : public IClient
- {
- public:
- Client();
- virtual ~Client();
-
- void tick() override;
- void renderTick(float lag) override;
- void onKeyEvent(int key, int scancode, int action, int mods) override;
- void onMouseClick(int button, int action, int mods) override;
- private:
- static const int KEY_LEFT = 0;
- static const int KEY_RIGHT = 1;
- static const int KEY_UP = 2;
- static const int KEY_DOWN = 3;
- static const int KEY_JUMP = 4;
- static const int KEY_SNEAK = 5;
-
- static const int KEY_CAM_LEFT = 6;
- static const int KEY_CAM_RIGHT = 7;
- static const int KEY_CAM_UP = 8;
- static const int KEY_CAM_DOWN = 9;
-
- static const int MOUSE_LEFT = 0;
-
- Clock tps;
- Clock fps;
-
- KeyManager keyManager;
- MouseManager mouseManager;
-
- Chunk chunk;
-
- Shader shader;
- DirectRenderer directRenderer;
- Vector3D position;
- float lengthAngle = 0;
- float widthAngle = 0;
- };
- #endif
|