mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-08 12:31:51 +00:00
refactor players
This commit is contained in:
parent
7f41f95013
commit
bd2acd5766
13 changed files with 101 additions and 151 deletions
|
|
@ -4,7 +4,6 @@
|
|||
#include <memory>
|
||||
#include <optional>
|
||||
|
||||
#include "interfaces/Object.hpp"
|
||||
#include "interfaces/Serializable.hpp"
|
||||
#include "settings.hpp"
|
||||
#include "voxels/voxel.hpp"
|
||||
|
|
@ -40,8 +39,9 @@ struct CursorSelection {
|
|||
entityid_t entity = ENTITY_NONE;
|
||||
};
|
||||
|
||||
class Player : public Object, public Serializable {
|
||||
class Player : public Serializable {
|
||||
Level* level;
|
||||
int64_t id;
|
||||
float speed;
|
||||
int chosenSlot;
|
||||
glm::vec3 position;
|
||||
|
|
@ -52,7 +52,7 @@ class Player : public Object, public Serializable {
|
|||
bool infiniteItems = true;
|
||||
bool instantDestruction = true;
|
||||
entityid_t eid;
|
||||
entityid_t selectedEid;
|
||||
entityid_t selectedEid = 0;
|
||||
public:
|
||||
std::shared_ptr<Camera> fpCamera, spCamera, tpCamera;
|
||||
std::shared_ptr<Camera> currentCamera;
|
||||
|
|
@ -62,6 +62,7 @@ public:
|
|||
|
||||
Player(
|
||||
Level* level,
|
||||
int64_t id,
|
||||
glm::vec3 position,
|
||||
float speed,
|
||||
std::shared_ptr<Inventory> inv,
|
||||
|
|
@ -115,7 +116,7 @@ public:
|
|||
|
||||
static void convert(dv::value& data, const ContentReport* report);
|
||||
|
||||
inline int getId() const {
|
||||
return objectUID;
|
||||
inline u64id_t getId() const {
|
||||
return id;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue