Validate that job and antag prototypes can actually be set in character profiles, rather than just checking if the prototype exists. Make preferences system just call existing validation code when loading prototype from database, instead of some hacked-together stuff. Also I made the character profile validation logic take dependencies in via parameter because fuck resolves.
26 lines
827 B
C#
26 lines
827 B
C#
using Content.Shared.Humanoid;
|
|
using Robust.Shared.Configuration;
|
|
using Robust.Shared.Prototypes;
|
|
|
|
namespace Content.Shared.Preferences
|
|
{
|
|
public interface ICharacterProfile
|
|
{
|
|
string Name { get; }
|
|
|
|
ICharacterAppearance CharacterAppearance { get; }
|
|
|
|
bool MemberwiseEquals(ICharacterProfile other);
|
|
|
|
/// <summary>
|
|
/// Makes this profile valid so there's no bad data like negative ages.
|
|
/// </summary>
|
|
void EnsureValid(IConfigurationManager configManager, IPrototypeManager prototypeManager);
|
|
|
|
/// <summary>
|
|
/// Gets a copy of this profile that has <see cref="EnsureValid"/> applied, i.e. no invalid data.
|
|
/// </summary>
|
|
ICharacterProfile Validated(IConfigurationManager configManager, IPrototypeManager prototypeManager);
|
|
}
|
|
}
|