Exemplo n.º 1
0
        /// <summary>
        /// Get a friendly name for the battle dimension.
        /// </summary>
        /// <param name="symbolCode">the symbol code</param>
        /// <returns>a friendly name for the battle dimension</returns>
        public static string GetName(string symbolCode)
        {
            int key          = GetCode(symbolCode);
            int codingScheme = CodingScheme.GetCode(symbolCode);

            switch (codingScheme)
            {
            case CodingScheme.EmergencyManagement:
                return(EmNames.ContainsKey(key) ? EmNames[key] : string.Empty);

            case CodingScheme.StabilityOperations:
                return(SoNames.ContainsKey(key) ? SoNames[key] : string.Empty);

            case CodingScheme.Intelligence:
            case CodingScheme.Warfighting:
                return(BdNames.ContainsKey(key) ? BdNames[key] : string.Empty);

            case CodingScheme.Weather:
                return(MetocNames.ContainsKey(key) ? MetocNames[key] : string.Empty);

            case CodingScheme.TacticalGraphics:
                return(TgNames.ContainsKey(key) ? TgNames[key] : string.Empty);
            }

            return(string.Empty);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Get the battle dimension code from the symbol code.
        /// </summary>
        /// <param name="symbolCode">the symbol code</param>
        /// <returns>the battle dimension code</returns>
        public static int GetCode(string symbolCode)
        {
            if (!SymbolData.Check(ref symbolCode))
            {
                return(0);
            }

            int codingScheme = CodingScheme.GetCode(symbolCode);

            switch (codingScheme)
            {
            case CodingScheme.EmergencyManagement:
                return(Ems.ContainsKey(symbolCode[EmIndex]) ? Ems[symbolCode[EmIndex]] : 0);

            case CodingScheme.StabilityOperations:
                return(Sos.ContainsKey(symbolCode[SoIndex]) ? Sos[symbolCode[SoIndex]] : 0);

            case CodingScheme.Intelligence:
            case CodingScheme.Warfighting:
                return(Bds.ContainsKey(symbolCode[BdIndex]) ? Bds[symbolCode[BdIndex]] : 0);

            case CodingScheme.Weather:
                return(Metocs.ContainsKey(symbolCode[MetocIndex]) ? Metocs[symbolCode[MetocIndex]] : 0);

            case CodingScheme.TacticalGraphics:
                return(Tgs.ContainsKey(symbolCode[TgIndex]) ? Tgs[symbolCode[TgIndex]] : 0);
            }

            return(0);
        }