Skip to content

Commit 71670e8

Browse files
committed
Updated the entity class
1 parent 5350ec8 commit 71670e8

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

include/entity.hpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "lib/UUID.hpp"
55

66
#include <string>
7+
#include <utility>
78

89
struct vec3 {
910
double x, y, z;
@@ -18,9 +19,21 @@ class Entity {
1819
vec3 _position;
1920
rot _rotation;
2021
UUID _entityId;
21-
std::string _entityName;
22+
std::string _entityType;
2223
std::string _dimensionName;
2324
// Status Flag
25+
public:
26+
explicit Entity(UUID id, std::string entityType, std::string dimensionName)
27+
: _entityId(id), _entityType(std::move(entityType)), _dimensionName(std::move(dimensionName)) {}
28+
virtual ~Entity() = default;
29+
30+
const std::string& getEnityType() const { return _entityType; }
31+
32+
vec3 getPosition() const { return _position; }
33+
void setPosition(vec3 position) { _position = position; }
34+
35+
rot getRotation() const { return _rotation; }
36+
void setRotation(rot rotation) { _rotation = rotation; }
2437
};
2538

2639
#endif

include/player.hpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,6 @@ class PlayerConfig {
4545
void setServerListings(bool serverListings) { _allowServerListings = serverListings; }
4646
};
4747

48-
struct vec3 {
49-
double x, y, z;
50-
};
51-
52-
class PlayerEntity {
53-
private:
54-
vec3 _position;
55-
};
56-
5748
class Player {
5849
private:
5950
std::string _name;

0 commit comments

Comments
 (0)