]> git.localhorst.tv Git - blank.git/blobdiff - src/world/Player.hpp
split input handling
[blank.git] / src / world / Player.hpp
index 68aa352efcdcbfa202a3b30e4f1af73ebe08c165..1f9af84118af1ca88e80d415257dcef7307453ca 100644 (file)
@@ -1,18 +1,34 @@
 #ifndef BLANK_WORLD_PLAYER_HPP_
 #define BLANK_WORLD_PLAYER_HPP_
 
+#include "Entity.hpp"
+
+
 namespace blank {
 
 class ChunkIndex;
-class Entity;
 
-struct Player {
+class Player {
+
+public:
+       Player(Entity &e, ChunkIndex &i);
+       ~Player();
+
+       Entity &GetEntity() const noexcept { return entity; }
+       const std::string &Name() const noexcept { return entity.Name(); }
+       Ray Aim() const { return entity.Aim(entity.ChunkCoords()); }
+
+       ChunkIndex &GetChunks() const noexcept { return chunks; }
+
+       void SetInventorySlot(int i) noexcept { inv_slot = i; }
+       int GetInventorySlot() const noexcept { return inv_slot; }
 
-       Entity *entity;
-       ChunkIndex *chunks;
+       void Update(int dt);
 
-       Player(Entity *e, ChunkIndex *i)
-       : entity(e), chunks(i) { }
+private:
+       Entity &entity;
+       ChunkIndex &chunks;
+       int inv_slot;
 
 };