mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 07:06:35 +09:00
Make Rulesets.Catch use the new judgement result structure
This commit is contained in:
@ -1,7 +1,9 @@
|
||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System.Collections.Generic;
|
||||
using osu.Game.Rulesets.Catch.Judgements;
|
||||
using osu.Game.Rulesets.Judgements;
|
||||
|
||||
namespace osu.Game.Rulesets.Catch.Objects
|
||||
{
|
||||
@ -9,6 +11,6 @@ namespace osu.Game.Rulesets.Catch.Objects
|
||||
{
|
||||
public override FruitVisualRepresentation VisualRepresentation => FruitVisualRepresentation.Banana;
|
||||
|
||||
public override CatchJudgement Judgement { get; } = new CatchBananaJudgement();
|
||||
protected override IEnumerable<Judgement> CreateJudgements() => new[] { new CatchBananaJudgement() };
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,8 @@
|
||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System.Collections.Generic;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Beatmaps.ControlPoints;
|
||||
using osu.Game.Rulesets.Judgements;
|
||||
using osu.Game.Rulesets.Objects;
|
||||
using osu.Game.Rulesets.Objects.Types;
|
||||
|
||||
@ -56,12 +54,6 @@ namespace osu.Game.Rulesets.Catch.Objects
|
||||
}
|
||||
|
||||
protected override HitWindows CreateHitWindows() => null;
|
||||
|
||||
protected override IEnumerable<Judgement> CreateJudgements()
|
||||
{
|
||||
if (this is ICatchObjectWithJudgement judgeable)
|
||||
yield return judgeable.Judgement;
|
||||
}
|
||||
}
|
||||
|
||||
public enum FruitVisualRepresentation
|
||||
|
@ -2,6 +2,7 @@
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Framework.Graphics;
|
||||
@ -56,10 +57,8 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
||||
{
|
||||
if (CheckPosition == null) return;
|
||||
|
||||
if (timeOffset >= 0 && HitObject is ICatchObjectWithJudgement judgeable)
|
||||
{
|
||||
ApplyJudgement(judgeable.Judgement, j => j.Result = CheckPosition.Invoke(HitObject) ? HitResult.Perfect : HitResult.Miss);
|
||||
}
|
||||
if (timeOffset >= 0 && Results.Count > 0)
|
||||
ApplyResult(Results.Single(), r => r.Type = CheckPosition.Invoke(HitObject) ? HitResult.Perfect : HitResult.Miss);
|
||||
}
|
||||
|
||||
protected override void SkinChanged(ISkinSource skin, bool allowFallback)
|
||||
|
@ -1,12 +1,14 @@
|
||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System.Collections.Generic;
|
||||
using osu.Game.Rulesets.Catch.Judgements;
|
||||
using osu.Game.Rulesets.Judgements;
|
||||
|
||||
namespace osu.Game.Rulesets.Catch.Objects
|
||||
{
|
||||
public class Droplet : CatchHitObject, ICatchObjectWithJudgement
|
||||
public class Droplet : CatchHitObject
|
||||
{
|
||||
public virtual CatchJudgement Judgement { get; } = new CatchDropletJudgement();
|
||||
protected override IEnumerable<Judgement> CreateJudgements() => new[] { new CatchDropletJudgement() };
|
||||
}
|
||||
}
|
||||
|
@ -1,12 +1,14 @@
|
||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System.Collections.Generic;
|
||||
using osu.Game.Rulesets.Catch.Judgements;
|
||||
using osu.Game.Rulesets.Judgements;
|
||||
|
||||
namespace osu.Game.Rulesets.Catch.Objects
|
||||
{
|
||||
public class Fruit : CatchHitObject, ICatchObjectWithJudgement
|
||||
public class Fruit : CatchHitObject
|
||||
{
|
||||
public virtual CatchJudgement Judgement { get; } = new CatchJudgement();
|
||||
protected override IEnumerable<Judgement> CreateJudgements() => new[] { new CatchJudgement() };
|
||||
}
|
||||
}
|
||||
|
@ -1,12 +0,0 @@
|
||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Game.Rulesets.Catch.Judgements;
|
||||
|
||||
namespace osu.Game.Rulesets.Catch.Objects
|
||||
{
|
||||
public interface ICatchObjectWithJudgement
|
||||
{
|
||||
CatchJudgement Judgement { get; }
|
||||
}
|
||||
}
|
@ -1,12 +1,14 @@
|
||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System.Collections.Generic;
|
||||
using osu.Game.Rulesets.Catch.Judgements;
|
||||
using osu.Game.Rulesets.Judgements;
|
||||
|
||||
namespace osu.Game.Rulesets.Catch.Objects
|
||||
{
|
||||
public class TinyDroplet : Droplet
|
||||
{
|
||||
public override CatchJudgement Judgement { get; } = new CatchTinyDropletJudgement();
|
||||
protected override IEnumerable<Judgement> CreateJudgements() => new[] { new CatchTinyDropletJudgement() };
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user