public static Color GetColor(this NotorietyType noto) { switch ((int)noto) { case Notoriety.Innocent: return(Color.SkyBlue); case Notoriety.Ally: return(Color.LawnGreen); case Notoriety.CanBeAttacked: case Notoriety.Criminal: return(Color.Silver); case Notoriety.Enemy: return(Color.OrangeRed); case Notoriety.Murderer: return(Color.Red); case Notoriety.Invulnerable: return(Color.Yellow); } return(Color.White); }
public PlayerNotoriety(NotorietyType type, string name) { Type = type; Name = name; }
public static int GetHue(this NotorietyType noto) { return(Notoriety.GetHue((int)noto)); }
// ReSharper restore UnusedMember.Local private static bool ParseCareerName( string input, out string name, out OriginType originType, out NotorietyType reputationType, out string className, out DateTime date) { name = null; className = null; originType = OriginType.None; reputationType = NotorietyType.None; date = DateTime.Now; var parts = input.Split('_'); if (parts.Length != 4) { return(false); } name = parts[0]; if (parts[1] == null || parts[1].Length != 2) { return(false); } switch (parts[1][0]) { case '0': { originType = OriginType.None; break; } case '1': { originType = OriginType.Spacer; break; } case '2': { originType = OriginType.Colony; break; } case '3': { originType = OriginType.Earthborn; break; } default: { return(false); } } switch (parts[1][1]) { case '0': { reputationType = NotorietyType.None; break; } case '1': { reputationType = NotorietyType.Survivor; break; } case '2': { reputationType = NotorietyType.Warhero; break; } case '3': { reputationType = NotorietyType.Ruthless; break; } default: { return(false); } } if (parts[2] == null) { return(false); } className = parts[2]; if (parts[3] == null || parts[3].Length != 6) { return(false); } /*if (parts[4] == null || parts[4].Length != 7) * { * return false; * }*/ int day; if (int.TryParse(parts[3].Substring(0, 2), out day) == false) { return(false); } int month; if (int.TryParse(parts[3].Substring(2, 2), out month) == false) { return(false); } int year; if (int.TryParse(parts[3].Substring(4, 2), out year) == false) { return(false); } date = new DateTime(2000 + year, month, day); return(true); }