mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-14 19:29:36 +01:00
Merge branch 'master' into robust-client-CEF
This commit is contained in:
@@ -587,17 +587,24 @@ namespace Robust.Shared.GameObjects
|
||||
|
||||
private static Box2 GetWorldAABB(in IEntity ent)
|
||||
{
|
||||
Vector2 pos;
|
||||
|
||||
if (ent.Deleted)
|
||||
{
|
||||
pos = ent.Transform.WorldPosition;
|
||||
return new Box2(pos, pos);
|
||||
}
|
||||
|
||||
if (ent.TryGetContainerMan(out var manager))
|
||||
{
|
||||
return GetWorldAABB(manager.Owner);
|
||||
}
|
||||
|
||||
var pos = ent.Transform.WorldPosition;
|
||||
pos = ent.Transform.WorldPosition;
|
||||
|
||||
if (ent.Deleted || !ent.TryGetComponent(out ILookupWorldBox2Component? lookup))
|
||||
return new Box2(pos, pos);
|
||||
|
||||
return lookup.GetWorldAABB(pos);
|
||||
return ent.TryGetComponent(out ILookupWorldBox2Component? lookup) ?
|
||||
lookup.GetWorldAABB(pos) :
|
||||
new Box2(pos, pos);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -20,10 +20,6 @@ namespace Robust.UnitTesting.Client.GameObjects.Components
|
||||
{
|
||||
var sim = RobustServerSimulation
|
||||
.NewSimulation()
|
||||
.RegisterComponents(factory =>
|
||||
{
|
||||
factory.RegisterClass<ContainerManagerComponent>();
|
||||
})
|
||||
.InitializeInstance();
|
||||
|
||||
var mapManager = sim.Resolve<IMapManager>();
|
||||
|
||||
@@ -16,7 +16,6 @@ namespace Robust.UnitTesting.Server.GameObjects.Components
|
||||
{
|
||||
var sim = RobustServerSimulation
|
||||
.NewSimulation()
|
||||
.RegisterComponents(factory => { factory.RegisterClass<ContainerManagerComponent>(); })
|
||||
.RegisterPrototypes(protoMan => protoMan.LoadString(PROTOTYPES))
|
||||
.InitializeInstance();
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ using Robust.Shared;
|
||||
using Robust.Shared.Asynchronous;
|
||||
using Robust.Shared.Configuration;
|
||||
using Robust.Shared.Console;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.ContentPack;
|
||||
using Robust.Shared.Exceptions;
|
||||
using Robust.Shared.GameObjects;
|
||||
@@ -229,6 +230,7 @@ namespace Robust.UnitTesting.Server
|
||||
compFactory.RegisterClass<PhysicsComponent>();
|
||||
compFactory.RegisterClass<EntityLookupComponent>();
|
||||
compFactory.RegisterClass<BroadphaseComponent>();
|
||||
compFactory.RegisterClass<ContainerManagerComponent>();
|
||||
|
||||
_regDelegate?.Invoke(compFactory);
|
||||
|
||||
|
||||
@@ -99,12 +99,14 @@ namespace Robust.UnitTesting.Shared.GameObjects
|
||||
}
|
||||
|
||||
var container = containerManagerComp.GetContainer("dummy");
|
||||
Assert.That(container.ContainedEntities.Count, Is.EqualTo(0));
|
||||
Assert.That(container.ExpectedEntities.Count, Is.EqualTo(1));
|
||||
Assert.That(container.ContainedEntities.Count, Is.EqualTo(1));
|
||||
Assert.That(container.ExpectedEntities.Count, Is.EqualTo(0));
|
||||
|
||||
/*
|
||||
var containerSystem = IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<ContainerSystem>();
|
||||
Assert.That(containerSystem.ExpectedEntities.ContainsKey(itemUid));
|
||||
Assert.That(containerSystem.ExpectedEntities.Count, Is.EqualTo(1));
|
||||
*/
|
||||
});
|
||||
|
||||
await server.WaitAssertion(() =>
|
||||
@@ -224,12 +226,14 @@ namespace Robust.UnitTesting.Shared.GameObjects
|
||||
}
|
||||
|
||||
var container = containerManagerComp.GetContainer("dummy");
|
||||
Assert.That(container.ContainedEntities.Count, Is.EqualTo(0));
|
||||
Assert.That(container.ExpectedEntities.Count, Is.EqualTo(1));
|
||||
Assert.That(container.ContainedEntities.Count, Is.EqualTo(1));
|
||||
Assert.That(container.ExpectedEntities.Count, Is.EqualTo(0));
|
||||
|
||||
/*
|
||||
var containerSystem = IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<ContainerSystem>();
|
||||
Assert.That(containerSystem.ExpectedEntities.ContainsKey(itemUid));
|
||||
Assert.That(containerSystem.ExpectedEntities.Count, Is.EqualTo(1));
|
||||
*/
|
||||
});
|
||||
|
||||
await server.WaitAssertion(() =>
|
||||
@@ -261,9 +265,11 @@ namespace Robust.UnitTesting.Shared.GameObjects
|
||||
Assert.That(container.ContainedEntities.Count, Is.EqualTo(0));
|
||||
Assert.That(container.ExpectedEntities.Count, Is.EqualTo(0));
|
||||
|
||||
/*
|
||||
var containerSystem = IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<ContainerSystem>();
|
||||
Assert.That(!containerSystem.ExpectedEntities.ContainsKey(itemUid));
|
||||
Assert.That(containerSystem.ExpectedEntities.Count, Is.EqualTo(0));
|
||||
*/
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -31,10 +31,6 @@ namespace Robust.UnitTesting.Shared.GameObjects.Systems
|
||||
{
|
||||
var sim = RobustServerSimulation
|
||||
.NewSimulation()
|
||||
.RegisterComponents(factory =>
|
||||
{
|
||||
factory.RegisterClass<ContainerManagerComponent>();
|
||||
})
|
||||
.RegisterPrototypes(f=>
|
||||
{
|
||||
f.LoadString(Prototypes);
|
||||
|
||||
Reference in New Issue
Block a user