aboutsummaryrefslogtreecommitdiff
path: root/src/shared/net/proto.hh
blob: d2bbd1c831648bd663d3659ded3537bad0e86736 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef SHARED_NET_PROTO_HH_
#define SHARED_NET_PROTO_HH_

#include "shared/math/math.hh"

#undef Status // Protobuf doesn't like xlib apparently.
#include "shared/net/lib/protobuf/net.pb.h"

// Helper functions for getting/setting simple structs for our protobuf.
namespace shared {
namespace net {

void set_angles(proto::angles* const proto,
                const shared::math::angles& angles) noexcept;
void set_coords(proto::coords* const proto,
                const shared::math::coords& coords) noexcept;
void set_vec3(proto::vec3* const proto, const glm::vec3& vec3) noexcept;
void set_ivec3(proto::ivec3* const proto, const glm::ivec3& ivec3) noexcept;

shared::math::angles get_angles(const proto::angles& proto) noexcept;
shared::math::coords get_coords(const proto::coords& proto) noexcept;
glm::vec3 get_vec3(const proto::vec3& proto) noexcept;
glm::ivec3 get_ivec3(const proto::ivec3& proto) noexcept;

} // namespace net
} // namespace shared

#endif