better example

This commit is contained in:
2025-02-18 19:09:40 +01:00
parent baa52d3baa
commit 2eab50932f
4 changed files with 45 additions and 23 deletions

View File

@@ -10,11 +10,7 @@ enum KeepAlivePacketFields {
};
using KeepAliveFields = std::tuple<
std::uint64_t, //<- KeepAliveId
sp::BitField<std::uint16_t,
sp::Field<std::uint16_t, 12>, //<- m_Tower
sp::Field<std::uint8_t, 4> //<- m_Upgrade
>
std::uint64_t //<- KeepAliveId
>;
DeclarePacket(KeepAlive){
@@ -24,12 +20,4 @@ DeclarePacket(KeepAlive){
std::uint64_t GetKeepAliveId() const {
return GetField<KeepAlive>();
}
std::uint16_t GetTowerId() const {
return GetField<TestAlignField>().GetField<0>();
}
std::uint8_t GetTowerUpgrade() const {
return GetField<TestAlignField>().GetField<1>();
}
};