Botcraft 26.3
Loading...
Searching...
No Matches
TurtleEntity.hpp
Go to the documentation of this file.
1#if PROTOCOL_VERSION > 340 /* > 1.12.2 */
2#pragma once
3
5
6namespace Botcraft
7{
9 {
10 private:
11 static constexpr std::array metadata_names{
12#if PROTOCOL_VERSION < 770 /* < 1.21.5 */
13 std::string_view("home_pos"),
14#endif
15 std::string_view("has_egg"),
16 std::string_view("laying_egg"),
17#if PROTOCOL_VERSION < 770 /* < 1.21.5 */
18 std::string_view("travel_pos"),
19 std::string_view("going_home"),
20 std::string_view("travelling"),
21#endif
22 };
23 protected:
24 static constexpr int metadata_count = static_cast<int>(metadata_names.size());
26
27 public:
29 virtual ~TurtleEntity();
30
31 // Object related stuff
32 virtual std::string GetName() const override;
33 virtual EntityType GetType() const override;
34
35 // Static stuff, for easier comparison
36 static std::string GetClassName();
37 static EntityType GetClassType();
38
39
40 virtual ProtocolCraft::Json::Value Serialize() const override;
41
42 // Metadata stuff
43#if PROTOCOL_VERSION < 770 /* < 1.21.5 */
44 Position GetHomePos() const;
45#endif
46 bool GetHasEgg() const;
47 bool GetLayingEgg() const;
48#if PROTOCOL_VERSION < 770 /* < 1.21.5 */
49 Position GetTravelPos() const;
50 bool GetGoingHome() const;
51 bool GetTravelling() const;
52#endif
53
54#if PROTOCOL_VERSION < 770 /* < 1.21.5 */
55 void SetHomePos(const Position& home_pos);
56#endif
57 void SetHasEgg(const bool has_egg);
58 void SetLayingEgg(const bool laying_egg);
59#if PROTOCOL_VERSION < 770 /* < 1.21.5 */
60 void SetTravelPos(const Position& travel_pos);
61 void SetGoingHome(const bool going_home);
62 void SetTravelling(const bool travelling);
63#endif
64
65 protected:
66 virtual double GetWidthImpl() const override;
67 virtual double GetHeightImpl() const override;
68
69 };
70}
71#endif
static constexpr int metadata_count
static constexpr int hierarchy_metadata_count
static EntityType GetClassType()
static constexpr int metadata_count
virtual double GetHeightImpl() const override
static constexpr std::array metadata_names
static std::string GetClassName()
static constexpr int hierarchy_metadata_count
virtual ProtocolCraft::Json::Value Serialize() const override
void SetLayingEgg(const bool laying_egg)
virtual double GetWidthImpl() const override
virtual EntityType GetType() const override
void SetHasEgg(const bool has_egg)
virtual std::string GetName() const override
Main class, basically a JsonVariant with extra utility functions it doesn't inherit JsonVariant direc...
Definition Json.hpp:45