Revert "Replace ResourcePath with ResPath (#3926)" (#3949)

This commit is contained in:
metalgearsloth
2023-04-20 11:43:51 +10:00
committed by GitHub
parent 6fb8df41e5
commit d646403068
87 changed files with 1179 additions and 449 deletions

View File

@@ -108,7 +108,9 @@ namespace Robust.Benchmarks.Serialization.Copy
copy.Potency = Seed.Potency;
copy.Ligneous = Seed.Ligneous;
copy.PlantRsi = new ResPath(Seed.PlantRsi.ToString());
copy.PlantRsi = Seed.PlantRsi == null
? null!
: new ResourcePath(Seed.PlantRsi.ToString(), Seed.PlantRsi.Separator);
copy.PlantIconState = Seed.PlantIconState;
copy.Bioluminescent = Seed.Bioluminescent;
copy.BioluminescentColor = Seed.BioluminescentColor;

View File

@@ -87,7 +87,7 @@ namespace Robust.Benchmarks.Serialization.Definitions
#endregion
#region Cosmetics
[DataField("plantRsi", required: true)] public ResPath PlantRsi { get; set; } = default!;
[DataField("plantRsi", required: true)] public ResourcePath PlantRsi { get; set; } = default!;
[DataField("plantIconState")] public string PlantIconState { get; set; } = "produce";
[DataField("bioluminescent")] public bool Bioluminescent { get; set; }
[DataField("bioluminescentColor")] public Color BioluminescentColor { get; set; } = Color.White;

View File

@@ -31,6 +31,17 @@ public class ResourcePathBench
}
return res;
}
[Benchmark]
public ResourcePath? CreateResourcePath()
{
ResourcePath? res = null;
for (var i = 0; i < N; i++)
{
res = new ResourcePath(_path);
}
return res;
}
}
#pragma warning restore CS0612