private void attemptCatch(Fruit fruit) { fruit.X += catcher.X; fruit.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty { CircleSize = circleSize }); foreach (var area in this.ChildrenOfType <CatcherArea>()) { DrawableFruit drawable = new DrawableFruit(fruit); area.Add(drawable); Schedule(() => { bool caught = area.AttemptCatch(fruit); area.OnNewResult(drawable, new JudgementResult(fruit, new CatchJudgement()) { Type = caught ? HitResult.Great : HitResult.Miss }); drawable.Expire(); }); } }
private void catchFruit(Fruit fruit, bool miss = false) { this.ChildrenOfType <CatcherArea>().ForEach(area => { DrawableFruit drawable = new DrawableFruit(fruit); area.Add(drawable); Schedule(() => { area.AttemptCatch(fruit); area.OnResult(drawable, new JudgementResult(fruit, new CatchJudgement()) { Type = miss ? HitResult.Miss : HitResult.Great }); drawable.Expire(); }); }); }
private void attemptCatch(Fruit fruit) { fruit.X = fruit.OriginalX + catcher.X; fruit.ApplyDefaults(new ControlPointInfo(), beatmapDifficulty); foreach (var area in this.ChildrenOfType <CatcherArea>()) { DrawableFruit drawable = new DrawableFruit(fruit); area.Add(drawable); Schedule(() => { area.OnNewResult(drawable, new CatchJudgementResult(fruit, new CatchJudgement()) { Type = area.MovableCatcher.CanCatch(fruit) ? HitResult.Great : HitResult.Miss }); drawable.Expire(); }); } }