Change character names to use datasets prototypes (#3259)

* Remove old name lists in .txts

* Fix tests

* LATEST MASTER TECHNOLOGY
This commit is contained in:
DrSmugleaf
2021-02-17 10:46:44 +01:00
committed by GitHub
parent 25c884a84d
commit c435b5150d
9 changed files with 70 additions and 2064 deletions

View File

@@ -1,8 +1,32 @@
namespace Content.Shared.Preferences
#nullable enable
using System;
using Content.Shared.Prototypes;
using Robust.Shared.IoC;
using Robust.Shared.Prototypes;
namespace Content.Shared.Preferences
{
public enum Sex
{
Male,
Female
}
public static class SexExtensions
{
public static DatasetPrototype FirstNames(this Sex sex, IPrototypeManager? prototypeManager = null)
{
prototypeManager ??= IoCManager.Resolve<IPrototypeManager>();
switch (sex)
{
case Sex.Male:
return prototypeManager.Index<DatasetPrototype>("names_first_male");
case Sex.Female:
return prototypeManager.Index<DatasetPrototype>("names_first_female");
default:
throw new ArgumentOutOfRangeException(nameof(sex), sex, null);
}
}
}
}