Client.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #ifndef CLIENT_H
  2. #define CLIENT_H
  3. #include "../engine/Wrapper.h"
  4. #include "../engine/KeyManager.h"
  5. #include "../engine/MouseManager.h"
  6. #include "../engine/Clock.h"
  7. #include "../engine/Shader.h"
  8. #include "../engine/DirectRenderer.h"
  9. #include "../world/World.h"
  10. using namespace std;
  11. class Client : public IClient
  12. {
  13. public:
  14. Client();
  15. virtual ~Client();
  16. void tick() override;
  17. void renderTick(float lag) override;
  18. void onKeyEvent(int key, int scancode, int action, int mods) override;
  19. void onMouseClick(int button, int action, int mods) override;
  20. private:
  21. static const int KEY_LEFT = 0;
  22. static const int KEY_RIGHT = 1;
  23. static const int KEY_UP = 2;
  24. static const int KEY_DOWN = 3;
  25. static const int KEY_JUMP = 4;
  26. static const int KEY_SNEAK = 5;
  27. static const int KEY_CAM_LEFT = 6;
  28. static const int KEY_CAM_RIGHT = 7;
  29. static const int KEY_CAM_UP = 8;
  30. static const int KEY_CAM_DOWN = 9;
  31. static const int KEY_CAM_TEST = 10;
  32. static const int MOUSE_LEFT = 0;
  33. Clock tps;
  34. Clock fps;
  35. KeyManager keyManager;
  36. MouseManager mouseManager;
  37. World world;
  38. Shader shader;
  39. DirectRenderer directRenderer;
  40. Vector3D position;
  41. float lengthAngle = 0;
  42. float widthAngle = 0;
  43. };
  44. #endif