Botcraft 26.3
Loading...
Searching...
No Matches
PositionPath.cpp
Go to the documentation of this file.
1#if PROTOCOL_VERSION > 776 /* > 26.2 */
3
5
8
9#include <stdexcept>
10
11namespace ProtocolCraft
12{
15
16 std::shared_ptr<PositionPathData> PositionPath::CreatePositionPathData(const PositionPathDataType type)
17 {
18 switch (type)
19 {
21 return std::make_shared<PositionPathLinear>();
23 return std::make_shared<PositionPathStepped>();
24 default: // Should not happen
25 throw std::runtime_error("Unable to create PositionPathData with id: " + std::to_string(static_cast<int>(type)) + ".");
26 return nullptr;
27 }
28 }
29
31}
32#endif
#define DEFINE_NETWORK_TYPE(ClassName)
static std::shared_ptr< PositionPathData > CreatePositionPathData(const PositionPathDataType type)