/// <summary> /// Checks to see if the symbol requires a dashed outline. /// </summary> /// <param name="symbolCode"> /// The symbol code to check. /// </param> /// <returns> /// A boolean to indicate whether the outline should be dashed. /// </returns> internal static bool IsDashed(string symbolCode) { if (!Check(ref symbolCode)) { return(false); } switch (StandardIdentity.GetCode(symbolCode)) { case StandardIdentity.Pending: case StandardIdentity.AssumedFriend: case StandardIdentity.Suspect: case StandardIdentity.ExercisePending: case StandardIdentity.ExerciseAssumedFriend: { return(true); } default: if (StatusOperationalCapacity.GetCode(symbolCode) == StatusOperationalCapacity.AnticipatedPlanned) { return(true); } return(false); } }
/// <summary> /// This is the current background color for this particular symbol /// </summary> /// <param name="symbolCode">The symbol code</param> /// <returns>A brush representing the current background color for the symbol code</returns> public static Brush FindColorScheme(string symbolCode) { if (!SymbolData.Check(ref symbolCode)) { return(null); } if (OrderOfBattle.GetCode(symbolCode) == OrderOfBattle.Civilian) { if (StandardIdentity.IsColorHostile(symbolCode)) { return(GetDefault(Reds, ColorScheme)); } return(GetDefault(Purples, ColorScheme)); } switch (StandardIdentity.GetCode(symbolCode)) { case StandardIdentity.AssumedFriend: case StandardIdentity.ExerciseFriend: case StandardIdentity.Friend: case StandardIdentity.ExerciseAssumedFriend: return(GetDefault(Blues, ColorScheme)); case StandardIdentity.Hostile: case StandardIdentity.Joker: case StandardIdentity.Faker: case StandardIdentity.Suspect: return(GetDefault(Reds, ColorScheme)); case StandardIdentity.ExerciseNeutral: case StandardIdentity.Neutral: return(GetDefault(Greens, ColorScheme)); case StandardIdentity.ExercisePending: case StandardIdentity.Pending: case StandardIdentity.Unknown: case StandardIdentity.ExerciseUnknown: return(GetDefault(Yellows, ColorScheme)); default: return(null); } }
public void StandardIdentityTest() { int gc = StandardIdentity.GetCode(string.Empty); Assert.AreEqual(gc, (char)0); gc = StandardIdentity.GetCode(null); Assert.AreEqual(gc, (char)0); gc = StandardIdentity.GetCode("qqqqqqqqqqqqqqq"); Assert.AreEqual(gc, (char)0); string str = StandardIdentity.GetName(string.Empty); Assert.AreEqual(str, string.Empty); str = StandardIdentity.GetName(null); Assert.AreEqual(str, string.Empty); str = StandardIdentity.GetName("qqqqqqqqqqqqqqq"); Assert.AreEqual(str, string.Empty); str = StandardIdentity.GetName("qApqqqqqqqqqqqn"); Assert.AreEqual(str, "Assumed Friend"); }