Refactor
This commit is contained in:
+10
-5
@@ -1,6 +1,7 @@
|
||||
#ifndef SRC_OBJECTS_PLAYER_H_
|
||||
#define SRC_OBJECTS_PLAYER_H_
|
||||
|
||||
#include <memory>
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
#include "../voxels/voxel.h"
|
||||
@@ -29,13 +30,14 @@ struct PlayerInput {
|
||||
|
||||
class Player {
|
||||
float speed;
|
||||
itemid_t chosenItem;
|
||||
public:
|
||||
Camera* camera, *SPCamera, *TPCamera, *currentViewCamera;
|
||||
Hitbox* hitbox;
|
||||
std::shared_ptr<Camera> camera, spCamera, tpCamera;
|
||||
std::shared_ptr<Camera> currentCamera;
|
||||
std::unique_ptr<Hitbox> hitbox;
|
||||
bool flight = false;
|
||||
bool noclip = false;
|
||||
bool debug = false;
|
||||
int chosenItem;
|
||||
voxel selectedVoxel {0, 0};
|
||||
|
||||
glm::vec2 cam = {};
|
||||
@@ -44,9 +46,12 @@ public:
|
||||
~Player();
|
||||
|
||||
void teleport(glm::vec3 position);
|
||||
|
||||
float getSpeed() const;
|
||||
void update(Level* level, PlayerInput& input, float delta);
|
||||
|
||||
void setChosenItem(itemid_t id);
|
||||
|
||||
itemid_t getChosenItem() const;
|
||||
float getSpeed() const;
|
||||
};
|
||||
|
||||
#endif /* SRC_OBJECTS_PLAYER_H_ */
|
||||
|
||||
Reference in New Issue
Block a user