Serv3 rework content changes (#7145)

This commit is contained in:
Paul Ritter
2022-04-03 02:01:22 +02:00
committed by GitHub
parent 6b01ab17a6
commit 2ff40d5a1f
133 changed files with 476 additions and 324 deletions

View File

@@ -16,13 +16,11 @@ namespace Content.Tests.Shared.Alert
{
const string PROTOTYPES = @"
- type: alert
name: AlertLowPressure
alertType: LowPressure
id: LowPressure
icon: /Textures/Interface/Alerts/Pressure/lowpressure.png
- type: alert
name: AlertHighPressure
alertType: HighPressure
id: HighPressure
icon: /Textures/Interface/Alerts/Pressure/highpressure.png
";

View File

@@ -25,50 +25,40 @@ namespace Content.Tests.Shared.Alert
- category: Temperature
- type: alert
name: AlertLowPressure
id: LowPressure
category: Pressure
alertType: LowPressure
- type: alert
name: AlertOverfed
id: Overfed
category: Hunger
alertType: Overfed
- type: alert
name: AlertHighPressure
id: HighPressure
category: Pressure
alertType: HighPressure
- type: alert
name: AlertPeckish
id: Peckish
category: Hunger
alertType: Peckish
- type: alert
name: AlertStun
alertType: Stun
id: Stun
- type: alert
name: AlertHandcuffed
alertType: Handcuffed
id: Handcuffed
- type: alert
name: AlertHot
id: Hot
category: Temperature
alertType: Hot
- type: alert
name: AlertCold
id: Cold
category: Temperature
alertType: Cold
- type: alert
name: AlertWeightless
alertType: Weightless
id: Weightless
- type: alert
name: AlertPilotingShuttle
alertType: PilotingShuttle
id: PilotingShuttle
";
[Test]
@@ -78,7 +68,7 @@ namespace Content.Tests.Shared.Alert
var prototypeManager = IoCManager.Resolve<IPrototypeManager>();
prototypeManager.Initialize();
prototypeManager.LoadFromStream(new StringReader(PROTOTYPES));
prototypeManager.Resync();
prototypeManager.ResolveResults();
var alertOrder = prototypeManager.EnumeratePrototypes<AlertOrderPrototype>().FirstOrDefault();

View File

@@ -15,7 +15,7 @@ namespace Content.Tests.Shared.Alert
{
private const string Prototypes = @"
- type: alert
alertType: HumanHealth
id: HumanHealth
category: Health
icon: /Textures/Interface/Alerts/Human/human.rsi/human.png
name: Health
@@ -78,7 +78,7 @@ namespace Content.Tests.Shared.Alert
var proto = (YamlMappingNode) rootNode[0];
var serMan = IoCManager.Resolve<ISerializationManager>();
return serMan.ReadValue<AlertPrototype>(new MappingDataNode(proto));
return serMan.Read<AlertPrototype>(new MappingDataNode(proto));
}
}
}

View File

@@ -16,14 +16,12 @@ namespace Content.Tests.Shared.Alert
{
const string PROTOTYPES = @"
- type: alert
name: AlertLowPressure
alertType: LowPressure
id: LowPressure
category: Pressure
icon: /Textures/Interface/Alerts/Pressure/lowpressure.png
- type: alert
name: AlertHighPressure
alertType: HighPressure
id: HighPressure
category: Pressure
icon: /Textures/Interface/Alerts/Pressure/highpressure.png
";
@@ -42,7 +40,7 @@ namespace Content.Tests.Shared.Alert
var factory = IoCManager.Resolve<IComponentFactory>();
factory.RegisterClass<AlertsComponent>();
prototypeManager.LoadFromStream(new StringReader(PROTOTYPES));
prototypeManager.Resync();
prototypeManager.ResolveResults();
var entSys = IoCManager.Resolve<IEntitySystemManager>();
entSys.LoadExtraSystemType<ServerAlertsSystem>();