mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-05 02:04:04 +00:00
chore: Change entity and component logic to use bitstream references (#1468)
* chore: Change entity and component logic to use bitstream references * merge
This commit is contained in:
@@ -48,7 +48,7 @@ TEST_F(DestroyableTest, PlacementNewAddComponentTest) {
|
||||
* Test Construction of a DestroyableComponent
|
||||
*/
|
||||
TEST_F(DestroyableTest, DestroyableComponentSerializeConstructionTest) {
|
||||
destroyableComponent->Serialize(&bitStream, true);
|
||||
destroyableComponent->Serialize(bitStream, true);
|
||||
// Assert that the full number of bits are present
|
||||
ASSERT_EQ(bitStream.GetNumberOfUnreadBits(), 748);
|
||||
{
|
||||
@@ -178,7 +178,7 @@ TEST_F(DestroyableTest, DestroyableComponentSerializeTest) {
|
||||
destroyableComponent->SetMaxHealth(1233.0f);
|
||||
|
||||
// Now we test a serialization for correctness.
|
||||
destroyableComponent->Serialize(&bitStream, false);
|
||||
destroyableComponent->Serialize(bitStream, false);
|
||||
ASSERT_EQ(bitStream.GetNumberOfUnreadBits(), 422);
|
||||
{
|
||||
// Now read in the full serialized BitStream
|
||||
|
@@ -30,7 +30,7 @@ protected:
|
||||
};
|
||||
|
||||
TEST_F(SimplePhysicsTest, SimplePhysicsSerializeTest) {
|
||||
simplePhysicsComponent->Serialize(&bitStream, false);
|
||||
simplePhysicsComponent->Serialize(bitStream, false);
|
||||
constexpr uint32_t sizeOfStream = 3 + BYTES_TO_BITS(3 * sizeof(NiPoint3)) + BYTES_TO_BITS(1 * sizeof(NiQuaternion)) + 1 * BYTES_TO_BITS(sizeof(uint32_t));
|
||||
ASSERT_EQ(bitStream.GetNumberOfBitsUsed(), sizeOfStream);
|
||||
|
||||
@@ -77,7 +77,7 @@ TEST_F(SimplePhysicsTest, SimplePhysicsSerializeTest) {
|
||||
}
|
||||
|
||||
TEST_F(SimplePhysicsTest, SimplePhysicsConstructionTest) {
|
||||
simplePhysicsComponent->Serialize(&bitStream, true);
|
||||
simplePhysicsComponent->Serialize(bitStream, true);
|
||||
constexpr uint32_t sizeOfStream = 4 + BYTES_TO_BITS(1 * sizeof(int32_t)) + BYTES_TO_BITS(3 * sizeof(NiPoint3)) + BYTES_TO_BITS(1 * sizeof(NiQuaternion)) + 1 * BYTES_TO_BITS(sizeof(uint32_t));
|
||||
ASSERT_EQ(bitStream.GetNumberOfBitsUsed(), sizeOfStream);
|
||||
|
||||
|
Reference in New Issue
Block a user