mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-08 12:31:51 +00:00
added serializable class
This commit is contained in:
parent
a9b55f35be
commit
8466c42896
6 changed files with 64 additions and 41 deletions
|
|
@ -7,6 +7,7 @@
|
|||
#include "../data/dynamic.h"
|
||||
#include "../voxels/voxel.h"
|
||||
#include "../settings.h"
|
||||
#include "../interfaces/Serializable.h"
|
||||
|
||||
class Camera;
|
||||
class Hitbox;
|
||||
|
|
@ -31,7 +32,7 @@ struct PlayerInput {
|
|||
bool flight;
|
||||
};
|
||||
|
||||
class Player {
|
||||
class Player : Serializable {
|
||||
float speed;
|
||||
int chosenSlot;
|
||||
glm::vec3 spawnpoint {};
|
||||
|
|
@ -65,7 +66,8 @@ public:
|
|||
void setSpawnPoint(glm::vec3 point);
|
||||
glm::vec3 getSpawnPoint() const;
|
||||
|
||||
std::unique_ptr<dynamic::Map> write() const;
|
||||
std::unique_ptr<dynamic::Map> serialize() const override;
|
||||
void deserialize(dynamic::Map *src) override;
|
||||
|
||||
static void convert(dynamic::Map* data, const ContentLUT* lut);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue