예제 #1
0
        private void ParseInterpretation(object[] aInterpretParams)
        {
            string interpretType = "";

            foreach (object interpretParam in aInterpretParams)
            {
                if (interpretParam is string)
                {
                    interpretType = interpretParam as string;
                }

                else if (interpretParam is int)
                {
                    InterpretationPairs.Add(new KeyValuePair <string, int>(interpretType, (int)interpretParam));
                }

                else if (interpretParam is int[])
                {
                    foreach (int interpretation in (int[])interpretParam)
                    {
                        InterpretationPairs.Add(new KeyValuePair <string, int>(interpretType, interpretation));
                    }
                }
            }
        }
예제 #2
0
        /// <summary> Whether this issue applies to the given difficulty level according to the metadata and interpretation. </summary>
        public bool AppliesToDifficulty(Beatmap.Difficulty aDifficulty)
        {
            bool appliesByMetadata =
                !(CheckOrigin.GetMetadata() is BeatmapCheckMetadata metadata) ||
                metadata.Difficulties.Contains(aDifficulty);

            bool appliesByInterpretation =
                !InterpretationPairs.Any() ||
                InterpretationPairs.Any(aPair =>
                                        aPair.Key == "difficulty" &&
                                        (Beatmap.Difficulty)aPair.Value == aDifficulty);

            return(appliesByMetadata && appliesByInterpretation);
        }