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}'")); }
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()); }
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}'")); }
internal static Pages.Races.Sex ToEdit(this Proto.Sex sex) { return((Pages.Races.Sex)sex); }