Exemplo n.º 1
0
 /// <summary>
 ///     获取指定Mod对应的键位
 /// </summary>
 /// <param name="mod"></param>
 /// <returns></returns>
 public Keys GetKey(OsuGameMod mod)
 {
     if (mod.ToString().Contains("Key"))
     {
         return(_mods.CheckIndexAndGetValue(OsuGameMod.Relax));
     }
     return(_mods.CheckIndexAndGetValue(mod));
 }
Exemplo n.º 2
0
        /// <summary>
        ///     使用Mod匹配录像
        /// </summary>
        /// <param name="mod"></param>
        /// <returns></returns>
        public ReplayCollection Find(OsuGameMod mod)
        {
            var r = new ReplayCollection();

            foreach (var replay in _rdata)
            {
                if (replay.Mods.Contains(mod))
                {
                    r._rdata.Add(replay);
                }
            }
            return(r);
        }
Exemplo n.º 3
0
 internal static Keys CheckIndexAndGetValue(this Dictionary <OsuGameMod, Keys> var, OsuGameMod index)
 {
     try
     {
         var tmp = index;
         if (index.ToString().Contains("Key"))
         {
             tmp = OsuGameMod.Relax;
         }
         if (index == OsuGameMod.NightCore)
         {
             tmp = OsuGameMod.DoubleTime;
         }
         if (index == OsuGameMod.Perfect)
         {
             tmp = OsuGameMod.SuddenDeath;
         }
         if (index == OsuGameMod.FadeIn)
         {
             tmp = OsuGameMod.Hidden;
         }
         if (index == OsuGameMod.Random)
         {
             tmp = OsuGameMod.AutoPilot;
         }
         return(var[tmp]);
     }
     catch (KeyNotFoundException)
     {
         Debug.WriteLine($"不支持的Mod:{index}");
         return((Keys)(-1));
     }
 }
Exemplo n.º 4
0
 /// <summary>
 ///     从Mod枚举获取Mod对象
 /// </summary>
 /// <param name="legacyMod"></param>
 /// <returns></returns>
 public static Mod FromLegacyMod(OsuGameMod legacyMod) => LegacyMods[legacyMod];