Bump engine to 0.19.0.0 (#8417)

This commit is contained in:
Pieter-Jan Briers
2022-05-28 16:29:12 +02:00
committed by GitHub
parent 5dbe77ecba
commit cb95d2ae8d
15 changed files with 31 additions and 14 deletions

View File

@@ -38,16 +38,15 @@ namespace Content.Benchmarks
IoCManager.Register<IEntitySystemManager, EntitySystemManager>(); IoCManager.Register<IEntitySystemManager, EntitySystemManager>();
IoCManager.RegisterInstance<IReflectionManager>(new Mock<IReflectionManager>().Object); IoCManager.RegisterInstance<IReflectionManager>(new Mock<IReflectionManager>().Object);
var dummyReg = new Mock<IComponentRegistration>(); var dummyReg = new ComponentRegistration(
dummyReg.SetupGet(p => p.Name).Returns("Dummy"); "Dummy",
dummyReg.SetupGet(p => p.Type).Returns(typeof(DummyComponent)); typeof(DummyComponent),
dummyReg.SetupGet(p => p.NetID).Returns((ushort?) null); CompIdx.Index<DummyComponent>());
dummyReg.SetupGet(p => p.References).Returns(new [] {typeof(DummyComponent)});
var componentFactory = new Mock<IComponentFactory>(); var componentFactory = new Mock<IComponentFactory>();
componentFactory.Setup(p => p.GetComponent<DummyComponent>()).Returns(new DummyComponent()); componentFactory.Setup(p => p.GetComponent<DummyComponent>()).Returns(new DummyComponent());
componentFactory.Setup(p => p.GetRegistration(It.IsAny<DummyComponent>())).Returns(dummyReg.Object); componentFactory.Setup(p => p.GetRegistration(It.IsAny<DummyComponent>())).Returns(dummyReg);
componentFactory.Setup(p => p.GetAllRefTypes()).Returns(new[] {typeof(DummyComponent)}); componentFactory.Setup(p => p.GetAllRefTypes()).Returns(new[] {CompIdx.Index<DummyComponent>()});
IoCManager.RegisterInstance<IComponentFactory>(componentFactory.Object); IoCManager.RegisterInstance<IComponentFactory>(componentFactory.Object);

View File

@@ -3,4 +3,5 @@ using Content.Shared.Access.Components;
namespace Content.Client.Access.Components; namespace Content.Client.Access.Components;
[RegisterComponent] [RegisterComponent]
[ComponentReference(typeof(SharedIdCardConsoleComponent))]
public sealed class IdCardConsoleComponent : SharedIdCardConsoleComponent {} public sealed class IdCardConsoleComponent : SharedIdCardConsoleComponent {}

View File

@@ -6,6 +6,7 @@ using Robust.Shared.GameObjects;
namespace Content.Client.Nutrition.Components namespace Content.Client.Nutrition.Components
{ {
[RegisterComponent] [RegisterComponent]
[ComponentReference(typeof(SharedHungerComponent))]
public sealed class HungerComponent : SharedHungerComponent public sealed class HungerComponent : SharedHungerComponent
{ {
private HungerThreshold _currentHungerThreshold; private HungerThreshold _currentHungerThreshold;

View File

@@ -1,7 +1,9 @@
using System.Collections.Generic; using System.Collections.Generic;
using Content.Server.Destructible; using Content.Server.Destructible;
using Content.Shared.GameTicking; using Content.Shared.GameTicking;
using Content.Shared.Module;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
namespace Content.IntegrationTests.Tests.Destructible namespace Content.IntegrationTests.Tests.Destructible
{ {
@@ -11,11 +13,17 @@ namespace Content.IntegrationTests.Tests.Destructible
/// </summary> /// </summary>
public sealed class TestDestructibleListenerSystem : EntitySystem public sealed class TestDestructibleListenerSystem : EntitySystem
{ {
[Dependency] private readonly IModuleManager _modManager;
public readonly List<DamageThresholdReached> ThresholdsReached = new(); public readonly List<DamageThresholdReached> ThresholdsReached = new();
public override void Initialize() public override void Initialize()
{ {
base.Initialize(); base.Initialize();
if (_modManager.IsClientModule)
return;
SubscribeLocalEvent<DestructibleComponent, DamageThresholdReached>(AddThresholdsToList); SubscribeLocalEvent<DestructibleComponent, DamageThresholdReached>(AddThresholdsToList);
SubscribeLocalEvent<RoundRestartCleanupEvent>(OnRoundRestart); SubscribeLocalEvent<RoundRestartCleanupEvent>(OnRoundRestart);
} }

View File

@@ -253,9 +253,9 @@ namespace Content.IntegrationTests.Tests
mapManager.DoMapInitialize(mapId); mapManager.DoMapInitialize(mapId);
}); });
var distinctComponents = new List<(List<Type> components, List<Type> references)> var distinctComponents = new List<(List<CompIdx> components, List<CompIdx> references)>
{ {
(new List<Type>(), new List<Type>()) (new List<CompIdx>(), new List<CompIdx>())
}; };
// Split components into groups, ensuring that their references don't conflict // Split components into groups, ensuring that their references don't conflict
@@ -272,14 +272,14 @@ namespace Content.IntegrationTests.Tests
// Ensure the next list if this one has conflicting references // Ensure the next list if this one has conflicting references
if (i + 1 >= distinctComponents.Count) if (i + 1 >= distinctComponents.Count)
{ {
distinctComponents.Add((new List<Type>(), new List<Type>())); distinctComponents.Add((new List<CompIdx>(), new List<CompIdx>()));
} }
continue; continue;
} }
// Add the component and its references if no conflicting references were found // Add the component and its references if no conflicting references were found
distinct.components.Add(type); distinct.components.Add(registration.Idx);
distinct.references.AddRange(registration.References); distinct.references.AddRange(registration.References);
} }
} }

View File

@@ -3,6 +3,7 @@ using Content.Shared.Climbing;
namespace Content.Server.Climbing.Components; namespace Content.Server.Climbing.Components;
[RegisterComponent] [RegisterComponent]
[ComponentReference(typeof(SharedClimbableComponent))]
public sealed class ClimbableComponent : SharedClimbableComponent public sealed class ClimbableComponent : SharedClimbableComponent
{ {
/// <summary> /// <summary>

View File

@@ -4,6 +4,7 @@ namespace Content.Server.Disposal.Tube.Components
{ {
[RegisterComponent] [RegisterComponent]
[ComponentReference(typeof(IDisposalTubeComponent))] [ComponentReference(typeof(IDisposalTubeComponent))]
[ComponentReference(typeof(DisposalTubeComponent))]
public sealed class DisposalBendComponent : DisposalTubeComponent public sealed class DisposalBendComponent : DisposalTubeComponent
{ {
[DataField("sideDegrees")] [DataField("sideDegrees")]

View File

@@ -7,6 +7,7 @@ namespace Content.Server.Disposal.Tube.Components
{ {
[RegisterComponent] [RegisterComponent]
[ComponentReference(typeof(IDisposalTubeComponent))] [ComponentReference(typeof(IDisposalTubeComponent))]
[ComponentReference(typeof(DisposalTubeComponent))]
public sealed class DisposalEntryComponent : DisposalTubeComponent public sealed class DisposalEntryComponent : DisposalTubeComponent
{ {
[Dependency] private readonly IEntityManager _entMan = default!; [Dependency] private readonly IEntityManager _entMan = default!;

View File

@@ -7,6 +7,7 @@ namespace Content.Server.Disposal.Tube.Components
[Virtual] [Virtual]
[RegisterComponent] [RegisterComponent]
[ComponentReference(typeof(IDisposalTubeComponent))] [ComponentReference(typeof(IDisposalTubeComponent))]
[ComponentReference(typeof(DisposalTubeComponent))]
public class DisposalJunctionComponent : DisposalTubeComponent public class DisposalJunctionComponent : DisposalTubeComponent
{ {
[Dependency] private readonly IEntityManager _entMan = default!; [Dependency] private readonly IEntityManager _entMan = default!;

View File

@@ -12,6 +12,7 @@ namespace Content.Server.Disposal.Tube.Components
{ {
[RegisterComponent] [RegisterComponent]
[ComponentReference(typeof(IDisposalTubeComponent))] [ComponentReference(typeof(IDisposalTubeComponent))]
[ComponentReference(typeof(DisposalTubeComponent))]
public sealed class DisposalRouterComponent : DisposalJunctionComponent public sealed class DisposalRouterComponent : DisposalJunctionComponent
{ {
[Dependency] private readonly IEntityManager _entMan = default!; [Dependency] private readonly IEntityManager _entMan = default!;

View File

@@ -11,6 +11,7 @@ namespace Content.Server.Disposal.Tube.Components
{ {
[RegisterComponent] [RegisterComponent]
[ComponentReference(typeof(IDisposalTubeComponent))] [ComponentReference(typeof(IDisposalTubeComponent))]
[ComponentReference(typeof(DisposalTubeComponent))]
public sealed class DisposalTaggerComponent : DisposalTransitComponent public sealed class DisposalTaggerComponent : DisposalTransitComponent
{ {
[Dependency] private readonly IEntityManager _entMan = default!; [Dependency] private readonly IEntityManager _entMan = default!;

View File

@@ -6,6 +6,7 @@ namespace Content.Server.Disposal.Tube.Components
[RegisterComponent] [RegisterComponent]
[ComponentReference(typeof(IDisposalTubeComponent))] [ComponentReference(typeof(IDisposalTubeComponent))]
[Virtual] [Virtual]
[ComponentReference(typeof(DisposalTubeComponent))]
public class DisposalTransitComponent : DisposalTubeComponent public class DisposalTransitComponent : DisposalTubeComponent
{ {
protected override Direction[] ConnectableDirections() protected override Direction[] ConnectableDirections()

View File

@@ -11,6 +11,7 @@ using Robust.Shared.Random;
namespace Content.Server.Nutrition.Components namespace Content.Server.Nutrition.Components
{ {
[RegisterComponent] [RegisterComponent]
[ComponentReference(typeof(SharedHungerComponent))]
public sealed class HungerComponent : SharedHungerComponent public sealed class HungerComponent : SharedHungerComponent
{ {
[Dependency] private readonly IEntityManager _entMan = default!; [Dependency] private readonly IEntityManager _entMan = default!;

View File

@@ -28,7 +28,7 @@ namespace Content.Shared.Whitelist
[DataField("components")] public string[]? Components = null; [DataField("components")] public string[]? Components = null;
[NonSerialized] [NonSerialized]
private List<IComponentRegistration>? _registrations = null; private List<ComponentRegistration>? _registrations = null;
/// <summary> /// <summary>
/// Tags that are allowed in the whitelist. /// Tags that are allowed in the whitelist.
@@ -48,7 +48,7 @@ namespace Content.Shared.Whitelist
if (Components == null) return; if (Components == null) return;
var compfact = IoCManager.Resolve<IComponentFactory>(); var compfact = IoCManager.Resolve<IComponentFactory>();
_registrations = new List<IComponentRegistration>(); _registrations = new List<ComponentRegistration>();
foreach (var name in Components) foreach (var name in Components)
{ {
var availability = compfact.GetComponentAvailability(name); var availability = compfact.GetComponentAvailability(name);