public HitSample(string aFileName) { Regex regex = new Regex(@"(?i)^(taiko-)?(soft|normal|drum)-(hit(whistle|normal|finish)|slider(slide|whistle|tick))(\d+)?"); Match match = regex.Match(aFileName); GroupCollection groups = match.Groups; taiko = groups[1].Success; sampleset = ParseSampleset(groups[2].Value); hitSource = ParseHitSource(groups[3].Value); // Can either be part of "hit/.../" or "slider/.../" if (groups[4].Success) { hitSound = ParseHitSound(groups[4].Value); } else if (groups[5].Success) { hitSound = ParseHitSound(groups[5].Value); } else { hitSound = null; } customIndex = ParseCustomIndex(groups[6].Value); }
public void TryHitHitSource() { var hitter = new HitSource(); var source = new MockClass(); hitter.Try(source, out var target); Assert.AreSame(source, target); }
public HitSample(int aCustomIndex, Beatmap.Sampleset?aSampleset, HitSound?aHitSound, HitSource aHitSource, double aTime) { customIndex = aCustomIndex; sampleset = aSampleset; hitSound = aHitSound; hitSource = aHitSource; time = aTime; }
public void TryHitReturnsTrue() { var hitter = new HitSource(); Assert.True(hitter.Try(default(MockClass), out _)); }