![]() |
FastEngine 0.9.3
A multiplayer oriented 2D engine made with Vulkan.
|
A class to manage a group of bits. More...
#include <C_bitBank.hpp>
Public Member Functions | |
void | clear () |
Clear the bank. | |
void | set (std::size_t index, bool flag) |
Set a bit to 1 or 0. | |
bool | get (std::size_t index) const |
Get the value of a bit. | |
uint8_t | getByte (std::size_t index) const |
Get the specified byte. | |
std::size_t | getSize () const |
Get the number of bytes in the bank. | |
void | pack (fge::net::Packet &pck) |
Pack the bank data into the packet. | |
void | unpack (fge::net::Packet &pck) |
Unpack the bank data from the packet. | |
A class to manage a group of bits.
TNbytes | The number of bytes in the bank. |
void fge::BitBank< TNbytes >::clear | ( | ) |
Clear the bank.
This function clear the bank by setting all bits to 0.
|
nodiscard |
Get the value of a bit.
This function get the value of the bit at the specified index.
index | The index of the bit to get |
|
nodiscard |
Get the specified byte.
index | The index of the byte to get |
|
nodiscard |
Get the number of bytes in the bank.
void fge::BitBank< TNbytes >::pack | ( | fge::net::Packet & | pck | ) |
Pack the bank data into the packet.
pck | The network packet to pack the bank data into |
void fge::BitBank< TNbytes >::set | ( | std::size_t | index, |
bool | flag ) |
Set a bit to 1 or 0.
This function set the bit at the specified index to 1 or 0.
index | The index of the bit to set |
flag | The value to set the bit to |
void fge::BitBank< TNbytes >::unpack | ( | fge::net::Packet & | pck | ) |
Unpack the bank data from the packet.
pck | The network packet to unpack the bank data from |