Revert "Refactor Game Modes" oh god oh fuck go back it was too good to be true (#5855)

This commit is contained in:
Paul Ritter
2021-12-21 19:25:52 +01:00
committed by GitHub
parent 8831d08229
commit 75721c214c
59 changed files with 1715 additions and 1971 deletions

View File

@@ -1,14 +1,10 @@
using System.Collections.Generic;
using Content.Server.GameTicking;
using Content.Server.GameTicking.Rules;
using Content.Server.Holiday.Greet;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Log;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
using Robust.Shared.ViewVariables;
namespace Content.Server.Spawners.Components
@@ -22,11 +18,11 @@ namespace Content.Server.Spawners.Components
public override string Name => "ConditionalSpawner";
[ViewVariables(VVAccess.ReadWrite)]
[DataField("prototypes", customTypeSerializer:typeof(PrototypeIdListSerializer<EntityPrototype>))]
[DataField("prototypes")]
public List<string> Prototypes { get; set; } = new();
[ViewVariables(VVAccess.ReadWrite)]
[DataField("gameRules", customTypeSerializer:typeof(PrototypeIdListSerializer<GameRulePrototype>))]
[DataField("gameRules")]
private readonly List<string> _gameRules = new();
[ViewVariables(VVAccess.ReadWrite)]
@@ -35,7 +31,7 @@ namespace Content.Server.Spawners.Components
public void RuleAdded(GameRuleAddedEvent obj)
{
if(_gameRules.Contains(obj.Rule.ID))
if(_gameRules.Contains(obj.Rule.GetType().Name))
Spawn();
}