]> git.localhorst.tv Git - blank.git/blob - src/world/Player.hpp
split input handling
[blank.git] / src / world / Player.hpp
1 #ifndef BLANK_WORLD_PLAYER_HPP_
2 #define BLANK_WORLD_PLAYER_HPP_
3
4 #include "Entity.hpp"
5
6
7 namespace blank {
8
9 class ChunkIndex;
10
11 class Player {
12
13 public:
14         Player(Entity &e, ChunkIndex &i);
15         ~Player();
16
17         Entity &GetEntity() const noexcept { return entity; }
18         const std::string &Name() const noexcept { return entity.Name(); }
19         Ray Aim() const { return entity.Aim(entity.ChunkCoords()); }
20
21         ChunkIndex &GetChunks() const noexcept { return chunks; }
22
23         void SetInventorySlot(int i) noexcept { inv_slot = i; }
24         int GetInventorySlot() const noexcept { return inv_slot; }
25
26         void Update(int dt);
27
28 private:
29         Entity &entity;
30         ChunkIndex &chunks;
31         int inv_slot;
32
33 };
34
35 }
36
37 #endif