Inline AddComponent

This commit is contained in:
Vera Aguilera Puerto
2021-12-03 11:33:40 +01:00
parent 2d130e31d6
commit f64df117be
18 changed files with 26 additions and 19 deletions

View File

@@ -28,10 +28,10 @@ namespace Content.IntegrationTests.Tests
var entMgr = IoCManager.Resolve<IEntityManager>();
var container = entMgr.SpawnEntity(null, MapCoordinates.Nullspace);
var inv = container.AddComponent<InventoryComponent>();
var inv = (InventoryComponent) IoCManager.Resolve<IEntityManager>().AddComponent<InventoryComponent>(container);
var child = entMgr.SpawnEntity(null, MapCoordinates.Nullspace);
var item = child.AddComponent<ClothingComponent>();
var item = (ClothingComponent) IoCManager.Resolve<IEntityManager>().AddComponent<ClothingComponent>(child);
item.SlotFlags = SlotFlags.HEAD;
// Equip item.

View File

@@ -92,7 +92,7 @@ namespace Content.IntegrationTests.Tests.Networking
var map = sMapManager.CreateMap();
var player = sPlayerManager.ServerSessions.Single();
serverEnt = sEntityManager.SpawnEntity(null, new MapCoordinates((0, 0), map));
serverComponent = serverEnt.AddComponent<PredictionTestComponent>();
serverComponent = IoCManager.Resolve<IEntityManager>().AddComponent<PredictionTestComponent>(serverEnt);
// Make client "join game" so they receive game state updates.
player.JoinGame();