Exemple #1
0
        public override LevelFilterResult FromChatString(string chatString, string option)
        {
            var         match = Regex.Match(chatString, @"(\w+) (.+)");
            MedalStatus medal;
            string      timeStr;

            if (match.Success)
            {
                if (!TryParseMedal(match.Groups[1].Value, out medal))
                {
                    return(new LevelFilterResult("Invalid medal for -time"));
                }
                timeStr = match.Groups[2].Value;
            }
            else
            {
                medal   = MedalStatus.Bronze;
                timeStr = chatString;
            }
            FloatComparison comparison = FloatComparison.ParseString(timeStr, TryParseTime);

            if (comparison != null)
            {
                return(new LevelFilterResult(new LevelFilterTime(medal, comparison)));
            }
            return(new LevelFilterResult("Invalid comparison/time for -time"));
        }
        public override LevelFilterResult FromChatString(string chatString, string option)
        {
            FloatComparison comparison = FloatComparison.ParseString(chatString);

            if (comparison != null)
            {
                return(new LevelFilterResult(new LevelFilterStars(comparison)));
            }
            return(new LevelFilterResult("Invalid comparison/number for -index"));
        }
Exemple #3
0
 public LevelFilterTime(MedalStatus medal, FloatComparison comparison)
 {
     this.medal      = medal;
     this.comparison = comparison;
 }
Exemple #4
0
 public LevelFilterTime()
 {
     medal      = MedalStatus.None;
     comparison = new FloatComparison(0);
 }
 public LevelFilterStars(FloatComparison comparison)
 {
     this.comparison = comparison;
 }
 public LevelFilterStars()
 {
     comparison = new FloatComparison(0);
 }