Beispiel #1
0
 public static bool Equals(this Proto.Sex one, Sex?two)
 {
     return(two == null ? one == Proto.Sex.Any :
            two == Sex.Male ? one == Proto.Sex.Male :
            two == Sex.Female ? one == Proto.Sex.Male :
            throw new System.NotImplementedException($"Unknown sex ' {two}'"));
 }
Beispiel #2
0
 internal static string FormatSex(Proto.Sex sex, bool anyAsEmpty = false)
 {
     return(sex == Proto.Sex.Any ? (anyAsEmpty ? "" : "Любой") :
            sex == Proto.Sex.Male ? "Муж" :
            sex == Proto.Sex.Female ? "Жен" :
            sex.ToString());
 }
Beispiel #3
0
 public static Sex?FromProto(this Proto.Sex sex)
 {
     return(sex == Proto.Sex.Any ? null :
            sex == Proto.Sex.Male ? Sex.Male :
            sex == Proto.Sex.Female ? Sex.Female :
            throw new System.NotImplementedException($"Unknown sex '{sex}'"));
 }
Beispiel #4
0
 internal static Pages.Races.Sex ToEdit(this Proto.Sex sex)
 {
     return((Pages.Races.Sex)sex);
 }