mirror of
https://github.com/Jous99/F4MP.git
synced 2026-01-13 00:00:54 +01:00
27 lines
573 B
C++
27 lines
573 B
C++
|
|
#include <Structs/Faction.h>
|
||
|
|
|
||
|
|
bool Faction::operator==(const Faction& acRhs) const noexcept
|
||
|
|
{
|
||
|
|
return Id == acRhs.Id && Rank == acRhs.Rank;
|
||
|
|
}
|
||
|
|
|
||
|
|
bool Faction::operator!=(const Faction& acRhs) const noexcept
|
||
|
|
{
|
||
|
|
return !this->operator==(acRhs);
|
||
|
|
}
|
||
|
|
|
||
|
|
void Faction::Serialize(TiltedPhoques::Buffer::Writer& aWriter) const noexcept
|
||
|
|
{
|
||
|
|
Id.Serialize(aWriter);
|
||
|
|
aWriter.WriteBits(Rank, 8);
|
||
|
|
}
|
||
|
|
|
||
|
|
void Faction::Deserialize(TiltedPhoques::Buffer::Reader& aReader) noexcept
|
||
|
|
{
|
||
|
|
Id.Deserialize(aReader);
|
||
|
|
|
||
|
|
uint64_t tmp;
|
||
|
|
aReader.ReadBits(tmp, 8);
|
||
|
|
Rank = tmp & 0xFF;
|
||
|
|
}
|