better serializer tests

This commit is contained in:
2024-10-24 22:59:44 +02:00
parent 8ad5dad046
commit c0473e5a65
4 changed files with 68 additions and 22 deletions

View File

@@ -40,6 +40,7 @@ DataBuffer& DataBuffer::operator>>(std::string& str) {
std::copy(m_Buffer.begin() + static_cast<difference_type>(m_ReadOffset),
m_Buffer.begin() + static_cast<difference_type>(m_ReadOffset + stringSize), str.begin());
m_ReadOffset += stringSize;
str.resize(stringSize - 1);
return *this;
}

View File

@@ -137,7 +137,8 @@ void Deserializer::DeserializeCommandData(cdata::End& a_Command) {}
void Serializer::SerializeCommandData(const cdata::PlaceTower& a_Command) {
m_Buffer << (static_cast<std::uint8_t>(a_Command.m_Type) << 4 | a_Command.m_Placer & 0xF) << a_Command.m_Position;
m_Buffer << static_cast<std::uint8_t>((static_cast<std::uint8_t>(a_Command.m_Type) << 4 | a_Command.m_Placer & 0xF))
<< a_Command.m_Position;
}
void Deserializer::DeserializeCommandData(cdata::PlaceTower& a_Command) {