// Headquarters(HQ)/Task Force(TF)/Feint/Dummy(FD) HQ/TF/FD Amplifier Icon // = StandardIdentityAffiliationType + SymbolSetType + HeadquartersTaskForceDummyType // Uses SIDC positions 4-6 and position 8 // ex. Friend(3), Land_Unit (10), Feint_Dummy (1) = 3101 // --> 3 (Friend) + Land_Unit (10) + 1 (Feint_Dummy) // public static string GetHqTfFdIconNameWithFolder( SymbolSetType symbolSet, StandardIdentityAffiliationType affiliation, HeadquartersTaskForceDummyType hqTfFd) { if (hqTfFd == HeadquartersTaskForceDummyType.NoHQTFDummyModifier) { return(string.Empty); } StringBuilder sb = new StringBuilder(); sb.Append("HQTFFD"); sb.Append(System.IO.Path.DirectorySeparatorChar); StandardIdentityAffiliationType mappedAffiliation = TypeUtilities.AffiliationToAffiliationFrameMapping[affiliation]; string affiliationValueString = TypeUtilities.EnumHelper.getEnumValAsString(mappedAffiliation, 1); sb.Append(affiliationValueString); // map the actual symbolSet to the supported/availble frame SymbolSetType mappedSymbolSet = TypeUtilities.SymbolSetToFrameMapping[symbolSet]; // Exceptional cases for this one if ((symbolSet == SymbolSetType.Activities) || (symbolSet == SymbolSetType.NotSet) || (symbolSet == SymbolSetType.Unknown)) { mappedSymbolSet = SymbolSetType.Land_Unit; } string mappedSymbolSetValueString = TypeUtilities.EnumHelper.getEnumValAsString(mappedSymbolSet, 2); sb.Append(mappedSymbolSetValueString); string hqTfFdValueString = TypeUtilities.EnumHelper.getEnumValAsString(hqTfFd, 1); sb.Append(hqTfFdValueString); sb.Append(ImageSuffix); return(sb.ToString()); }
// same as ImageFilesHome + GetHqTfFdIconNameWithFolder public static string GetHqTfFdIconNameWithFullPath( SymbolSetType symbolSet, StandardIdentityAffiliationType affiliation, HeadquartersTaskForceDummyType hqTfFd) { if (hqTfFd == HeadquartersTaskForceDummyType.NoHQTFDummyModifier) { return(string.Empty); } StringBuilder sb = new StringBuilder(); sb.Append(ImageFilesHome); string hqTfFdIconNameWithoutImageFilesHome = GetHqTfFdIconNameWithFolder(symbolSet, affiliation, hqTfFd); sb.Append(hqTfFdIconNameWithoutImageFilesHome); return(sb.ToString()); }
void setSymbolState(string valueSelected = "") { // TODO: Figure out a way to set this consistent naming scheme better string symbolSetName = currentSymbol.Id.SymbolSet.ToString().Replace("_", " "); if (string.IsNullOrEmpty(valueSelected)) { // this is a special state (i.e. hack) to simulate a button press, to force // into the next state, when the previous panel is empty } else if (currentPane == PaneSequenceType.AffiliationPane) { string affiliationSelectedString = valueSelected; StandardIdentityAffiliationType affiliationSelection = (StandardIdentityAffiliationType) TypeUtilities.EnumHelper.getEnumFromString( typeof(StandardIdentityAffiliationType), affiliationSelectedString); currentSymbol.Id.Affiliation = affiliationSelection; currentPane = PaneSequenceType.SymbolSetPane; } else if (currentPane == PaneSequenceType.SymbolSetPane) { string symbolSetSelectedString = valueSelected; SymbolSetType symbolSetSelection = (SymbolSetType) TypeUtilities.EnumHelper.getEnumFromString( typeof(SymbolSetType), symbolSetSelectedString); currentSymbol.Id.SymbolSet = symbolSetSelection; currentPane = PaneSequenceType.EntityPane; } else if (currentPane == PaneSequenceType.EntityPane) { if (valueSelected == NOT_SET) { currentPane = PaneSequenceType.Modifier1Pane; } else { currentEntityName = valueSelected; string entityCode = symbolLookup.GetEntityCode(currentSymbol.Id.SymbolSet, currentEntityName); currentSymbol.Id.EntityCode = entityCode; currentPane = PaneSequenceType.EntityTypePane; } } else if (currentPane == PaneSequenceType.EntityTypePane) { if (valueSelected == NOT_SET) { currentPane = PaneSequenceType.Modifier1Pane; } else { currentEntityTypeName = valueSelected; string entityCode = symbolLookup.GetEntityCode(currentSymbol.Id.SymbolSet, currentEntityName, currentEntityTypeName); currentSymbol.Id.EntityCode = entityCode; currentPane = PaneSequenceType.EntitySubTypePane; } } else if (currentPane == PaneSequenceType.EntitySubTypePane) { if (valueSelected == NOT_SET) { currentPane = PaneSequenceType.Modifier1Pane; } else { currentEntitySubTypeName = valueSelected; string entityCode = symbolLookup.GetEntityCode(currentSymbol.Id.SymbolSet, currentEntityName, currentEntityTypeName, currentEntitySubTypeName); currentSymbol.Id.EntityCode = entityCode; currentPane = PaneSequenceType.Modifier1Pane; } } else if (currentPane == PaneSequenceType.Modifier1Pane) { string currentModifier1Name = valueSelected; string modifier1Code = symbolLookup.GetModifierCodeFromName( currentSymbol.Id.SymbolSet, 1, currentModifier1Name); currentSymbol.Id.ModifierOne = modifier1Code; currentPane = PaneSequenceType.Modifier2Pane; } else if (currentPane == PaneSequenceType.Modifier2Pane) { string currentModifier2Name = valueSelected; string modifier2Code = symbolLookup.GetModifierCodeFromName( currentSymbol.Id.SymbolSet, 2, currentModifier2Name); currentSymbol.Id.ModifierTwo = modifier2Code; currentPane = PaneSequenceType.EchelonMobilityPane; } else if (currentPane == PaneSequenceType.EchelonMobilityPane) { string currentEchelonMobilityName = valueSelected; EchelonMobilityType echelonMobilitySelection = (EchelonMobilityType) TypeUtilities.EnumHelper.getEnumFromString( typeof(EchelonMobilityType), currentEchelonMobilityName); currentSymbol.Id.EchelonMobility = echelonMobilitySelection; currentPane = PaneSequenceType.HqTfFdPane; } else if (currentPane == PaneSequenceType.HqTfFdPane) { string currentHqTfFdName = valueSelected; HeadquartersTaskForceDummyType hqTfFdSelection = (HeadquartersTaskForceDummyType) TypeUtilities.EnumHelper.getEnumFromString( typeof(HeadquartersTaskForceDummyType), currentHqTfFdName); currentSymbol.Id.HeadquartersTaskForceDummy = hqTfFdSelection; currentPane = PaneSequenceType.StatusPane; } else if (currentPane == PaneSequenceType.StatusPane) { string currentStatusName = valueSelected; StatusType statusSelection = (StatusType)TypeUtilities.EnumHelper.getEnumFromString( typeof(StatusType), currentStatusName); currentSymbol.Id.Status = statusSelection; currentPane = PaneSequenceType.StartOver; } else if (currentPane == PaneSequenceType.StartOver) { // Reset the other values resetSymbolState(); // Go back when we are done currentPane = PaneSequenceType.SymbolSetPane; } setTagLabel(); updatePictureBox(); // Go To Next Pane SetPaneState(); }