mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
Generalize component trees (#3598)
This commit is contained in:
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using NUnit.Framework;
|
||||
using Robust.Client.ComponentTrees;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Server.Containers;
|
||||
using Robust.Server.Debugging;
|
||||
@@ -120,6 +121,7 @@ namespace Robust.UnitTesting
|
||||
var mapMan = deps.Resolve<IMapManager>();
|
||||
|
||||
// Required components for the engine to work
|
||||
// Why are we still here? Just to suffer? Why can't we just use [RegisterComponent] magic?
|
||||
var compFactory = deps.Resolve<IComponentFactory>();
|
||||
|
||||
if (!compFactory.AllRegisteredTypes.Contains(typeof(MapComponent)))
|
||||
@@ -157,6 +159,26 @@ namespace Robust.UnitTesting
|
||||
compFactory.RegisterClass<JointComponent>();
|
||||
}
|
||||
|
||||
if (!compFactory.AllRegisteredTypes.Contains(typeof(OccluderComponent)))
|
||||
{
|
||||
compFactory.RegisterClass<OccluderComponent>();
|
||||
}
|
||||
|
||||
if (!compFactory.AllRegisteredTypes.Contains(typeof(OccluderTreeComponent)))
|
||||
{
|
||||
compFactory.RegisterClass<OccluderTreeComponent>();
|
||||
}
|
||||
|
||||
if (!compFactory.AllRegisteredTypes.Contains(typeof(SpriteTreeComponent)))
|
||||
{
|
||||
compFactory.RegisterClass<SpriteTreeComponent>();
|
||||
}
|
||||
|
||||
if (!compFactory.AllRegisteredTypes.Contains(typeof(LightTreeComponent)))
|
||||
{
|
||||
compFactory.RegisterClass<LightTreeComponent>();
|
||||
}
|
||||
|
||||
// So by default EntityManager does its own EntitySystemManager initialize during Startup.
|
||||
// We want to bypass this and load our own systems hence we will manually initialize it here.
|
||||
entMan.Initialize();
|
||||
|
||||
@@ -257,6 +257,7 @@ namespace Robust.UnitTesting.Server
|
||||
|
||||
var compFactory = container.Resolve<IComponentFactory>();
|
||||
|
||||
// if only we had some sort of attribute for autmatically registering components.
|
||||
compFactory.RegisterClass<MetaDataComponent>();
|
||||
compFactory.RegisterClass<TransformComponent>();
|
||||
compFactory.RegisterClass<MapGridComponent>();
|
||||
@@ -269,6 +270,8 @@ namespace Robust.UnitTesting.Server
|
||||
compFactory.RegisterClass<PhysicsMapComponent>();
|
||||
compFactory.RegisterClass<FixturesComponent>();
|
||||
compFactory.RegisterClass<CollisionWakeComponent>();
|
||||
compFactory.RegisterClass<OccluderComponent>();
|
||||
compFactory.RegisterClass<OccluderTreeComponent>();
|
||||
|
||||
_regDelegate?.Invoke(compFactory);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user