Updated serializer data fields (#2702)

This commit is contained in:
ColdAutumnRain
2020-12-04 11:06:53 +01:00
committed by GitHub
parent 87149e18b5
commit 216a47dddc
12 changed files with 37 additions and 37 deletions

View File

@@ -46,9 +46,9 @@ namespace Content.Server.GameObjects.Components.Markers
public override void ExposeData(ObjectSerializer serializer)
{
base.ExposeData(serializer);
serializer.DataField(this, x => Prototypes, "prototypes", new List<string>());
serializer.DataField(this, x => Chance, "chance", 1.0f);
serializer.DataField(this, x => _gameRules, "gameRules", new List<string>());
serializer.DataField(this, x => x.Prototypes, "prototypes", new List<string>());
serializer.DataField(this, x => x.Chance, "chance", 1.0f);
serializer.DataField(this, x => x._gameRules, "gameRules", new List<string>());
}
private void RuleAdded(GameRuleAddedEventArgs obj)

View File

@@ -53,11 +53,11 @@ namespace Content.Server.GameObjects.Components.Markers
{
base.ExposeData(serializer);
serializer.DataField(this, x => Prototypes, "prototypes", new List<string>());
serializer.DataField(this, x => Chance, "chance", 1.0f);
serializer.DataField(this, x => IntervalSeconds, "intervalSeconds", 60);
serializer.DataField(this, x => MinimumEntitiesSpawned, "minimumEntitiesSpawned", 1);
serializer.DataField(this, x => MaximumEntitiesSpawned, "maximumEntitiesSpawned", 1);
serializer.DataField(this, x => x.Prototypes, "prototypes", new List<string>());
serializer.DataField(this, x => x.Chance, "chance", 1.0f);
serializer.DataField(this, x => x.IntervalSeconds, "intervalSeconds", 60);
serializer.DataField(this, x => x.MinimumEntitiesSpawned, "minimumEntitiesSpawned", 1);
serializer.DataField(this, x => x.MaximumEntitiesSpawned, "maximumEntitiesSpawned", 1);
if(MinimumEntitiesSpawned > MaximumEntitiesSpawned)
throw new ArgumentException("MaximumEntitiesSpawned can't be lower than MinimumEntitiesSpawned!");

View File

@@ -30,9 +30,9 @@ namespace Content.Server.GameObjects.Components.Markers
public override void ExposeData(ObjectSerializer serializer)
{
base.ExposeData(serializer);
serializer.DataField(this, x => RarePrototypes, "rarePrototypes", new List<string>());
serializer.DataField(this, x => RareChance, "rareChance", 0.05f);
serializer.DataField(this, x => Offset, "offset", 0.2f);
serializer.DataField(this, x => x.RarePrototypes, "rarePrototypes", new List<string>());
serializer.DataField(this, x => x.RareChance, "rareChance", 0.05f);
serializer.DataField(this, x => x.Offset, "offset", 0.2f);
}
public override void Spawn()
{