* Added preferences backend * Gender -> Sex * ClientPreferencesManager properties * Username validation * Fixed client init * WIP db * Actually working sqlite db * Dropped shitty sqlite libraries, dropped DbUp, added MigrationManager * Added profile deletion, test * Docs, sanity, tests, cleanup * Cleaned up profile and appearance, fixed running on .net core Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>
37 lines
1.2 KiB
C#
37 lines
1.2 KiB
C#
using System;
|
|
using Robust.Shared.Serialization;
|
|
|
|
namespace Content.Shared.Preferences
|
|
{
|
|
[Serializable, NetSerializable]
|
|
public class HumanoidCharacterProfile : ICharacterProfile
|
|
{
|
|
public static HumanoidCharacterProfile Default()
|
|
{
|
|
return new HumanoidCharacterProfile
|
|
{
|
|
Name = "John Doe",
|
|
Age = 18,
|
|
Sex = Sex.Male,
|
|
CharacterAppearance = HumanoidCharacterAppearance.Default()
|
|
};
|
|
}
|
|
|
|
public string Name { get; set; }
|
|
public int Age { get; set; }
|
|
public Sex Sex { get; set; }
|
|
public ICharacterAppearance CharacterAppearance { get; set; }
|
|
|
|
public bool MemberwiseEquals(ICharacterProfile maybeOther)
|
|
{
|
|
if (!(maybeOther is HumanoidCharacterProfile other)) return false;
|
|
if (Name != other.Name) return false;
|
|
if (Age != other.Age) return false;
|
|
if (Sex != other.Sex) return false;
|
|
if (CharacterAppearance is null)
|
|
return other.CharacterAppearance is null;
|
|
return CharacterAppearance.MemberwiseEquals(other.CharacterAppearance);
|
|
}
|
|
}
|
|
}
|