X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fworld%2FPlayer.hpp;fp=src%2Fworld%2FPlayer.hpp;h=1f9af84118af1ca88e80d415257dcef7307453ca;hb=b066e776622f96e906600a0c4a08de392bd03676;hp=68aa352efcdcbfa202a3b30e4f1af73ebe08c165;hpb=e1209ec25c4cc91e13889876106f56bd51aa96e2;p=blank.git diff --git a/src/world/Player.hpp b/src/world/Player.hpp index 68aa352..1f9af84 100644 --- a/src/world/Player.hpp +++ b/src/world/Player.hpp @@ -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; };