Use shared before local
This commit is contained in:
@ -5,6 +5,11 @@ public interface IPerson
|
||||
|
||||
// ...
|
||||
|
||||
Models.PersonName TestStatic_GetPersonName(string name) =>
|
||||
GetPersonName(name);
|
||||
static Models.PersonName GetPersonName(string name) =>
|
||||
PersonName.Create(name);
|
||||
|
||||
bool TestStatic_IsDefaultName(string mappingDefaultName, string value) =>
|
||||
IsDefaultName(mappingDefaultName, value);
|
||||
static bool IsDefaultName(string mappingDefaultName, string value) =>
|
||||
|
@ -23,6 +23,16 @@ public interface IPersonBirthday
|
||||
static double? GetAge(Models.PersonBirthday birthday) =>
|
||||
PersonBirthday.GetAge(birthday);
|
||||
|
||||
int TestStatic_GetHour(bool alive, char sex) =>
|
||||
GetHour(alive, sex);
|
||||
static int GetHour(bool alive, char sex) =>
|
||||
alive ? sex is 'M' ? 5 : sex is 'F' ? 4 : sex is 'U' ? 2 : throw new NotImplementedException() : sex is 'M' ? 15 : sex is 'F' ? 14 : sex is 'U' ? 3 : throw new NotImplementedException();
|
||||
|
||||
int TestStatic_GetHour(bool alive, ConsoleKey consoleKey) =>
|
||||
GetHour(alive, consoleKey);
|
||||
static int GetHour(bool alive, ConsoleKey consoleKey) =>
|
||||
GetHour(alive, consoleKey.ToString()[0]);
|
||||
|
||||
Models.PersonBirthday TestStatic_GetPersonBirthday(long ticks) =>
|
||||
new(new(ticks));
|
||||
static Models.PersonBirthday GetPersonBirthday(long ticks) =>
|
||||
|
@ -166,11 +166,8 @@ internal abstract class Person
|
||||
sexLine = "1 SEX U";
|
||||
else
|
||||
{
|
||||
string code;
|
||||
if (deathLine is null or not "1 DEAT Y")
|
||||
code = sexLine[6] is 'M' ? "05" : sexLine[6] is 'F' ? "04" : sexLine[6] is 'U' ? "02" : throw new NotImplementedException();
|
||||
else
|
||||
code = sexLine[6] is 'M' ? "15" : sexLine[6] is 'F' ? "14" : sexLine[6] is 'U' ? "03" : throw new NotImplementedException();
|
||||
int hours = IPersonBirthday.GetHour(deathLine is null or not "1 DEAT Y", sexLine[6]);
|
||||
string code = hours.ToString("00");
|
||||
if (directory.EndsWith("00"))
|
||||
directory = string.Concat(directory[..^2], code);
|
||||
else if (directory.EndsWith("01"))
|
||||
|
Reference in New Issue
Block a user