Skip to content

Commit

Permalink
Update Bridge.dll
Browse files Browse the repository at this point in the history
Comments for `PlayerMappingTest`
  • Loading branch information
VirxEC committed Dec 15, 2024
1 parent 18679fd commit 1a0bb93
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Binary file modified RLBotCS/lib/Bridge.dll
Binary file not shown.
7 changes: 5 additions & 2 deletions RLBotCSTests/PlayerMappingTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ public void TestSpawnProcess()
IsBot = true
};

// add pending spawn
_playerMapping.AddPendingSpawn(spawnTracker);

// apply car spawn from known player
var metadata = _playerMapping.ApplyCarSpawn(actorId, commandId);

Assert.AreEqual(desiredIndex, _playerMapping.PlayerIndexFromActorId(actorId));
Expand All @@ -42,19 +44,20 @@ public void TestSpawnProcess()
Assert.IsTrue(metadata.IsBot);
Assert.IsTrue(!metadata.IsCustomBot);

// apply car spawn from unknown player
var metadata2 = _playerMapping.ApplyCarSpawn(111, 222);
uint? index = _playerMapping.PlayerIndexFromActorId(111);

Assert.AreEqual(0u, _playerMapping.PlayerIndexFromActorId(111));
Assert.IsNotNull(index);
Assert.AreEqual(index, 0u);
Assert.AreEqual(0u, index);
Assert.IsNull(metadata2.SpawnId);
Assert.AreEqual(desiredIndex, _playerMapping.PlayerIndexFromActorId(actorId));
Assert.IsTrue(!metadata2.IsBot);
Assert.IsTrue(!metadata2.IsCustomBot);

uint? index2 = _playerMapping.PlayerIndexFromActorId(456);

Assert.IsNull(index2);
Assert.AreNotEqual(index2, 0u);
}
}

0 comments on commit 1a0bb93

Please sign in to comment.