]> git.localhorst.tv Git - blank.git/blob - src/world/Player.hpp
more fun with AI/steering
[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 BlockLookup;
10 class ChunkIndex;
11
12 class Player {
13
14 public:
15         Player(Entity &e, ChunkIndex &i);
16         ~Player();
17
18         Entity &GetEntity() const noexcept { return entity; }
19         const std::string &Name() const noexcept { return entity.Name(); }
20         Ray Aim() const { return entity.Aim(entity.ChunkCoords()); }
21
22         ChunkIndex &GetChunks() const noexcept { return chunks; }
23
24         void SetInventorySlot(int i) noexcept { inv_slot = i; }
25         int GetInventorySlot() const noexcept { return inv_slot; }
26
27         bool SuitableSpawn(BlockLookup &) const noexcept;
28
29         void Update(int dt);
30
31 private:
32         Entity &entity;
33         ChunkIndex &chunks;
34         int inv_slot;
35
36 };
37
38 }
39
40 #endif