17#ifndef _FGE_C_BITBANK_HPP_INCLUDED
18#define _FGE_C_BITBANK_HPP_INCLUDED
20#include "FastEngine/network/C_packet.hpp"
32template<std::
size_t TN
bytes>
35 static_assert(TNbytes > 0,
"TNbytes must be greater than 0");
56 void set(std::size_t index,
bool flag);
65 [[nodiscard]]
bool get(std::size_t index)
const;
72 [[nodiscard]] uint8_t
getByte(std::size_t index)
const;
79 [[nodiscard]] std::size_t
getSize()
const;
95 uint8_t g_data[TNbytes]{0};
100#include "C_bitBank.inl"
A class to manage a group of bits.
Definition C_bitBank.hpp:34
bool get(std::size_t index) const
Get the value of a bit.
Definition C_bitBank.inl:38
void unpack(fge::net::Packet &pck)
Unpack the bank data from the packet.
Definition C_bitBank.inl:68
void pack(fge::net::Packet &pck)
Pack the bank data into the packet.
Definition C_bitBank.inl:63
std::size_t getSize() const
Get the number of bytes in the bank.
Definition C_bitBank.inl:57
void set(std::size_t index, bool flag)
Set a bit to 1 or 0.
Definition C_bitBank.inl:30
uint8_t getByte(std::size_t index) const
Get the specified byte.
Definition C_bitBank.inl:47
void clear()
Clear the bank.
Definition C_bitBank.inl:21
Definition C_packet.hpp:70