private void testSingle(float circleSize, bool auto = false, double timeOffset = 0, Vector2?positionOffset = null) { positionOffset = positionOffset ?? Vector2.Zero; var circle = new HitCircle { StartTime = Time.Current + 1000 + timeOffset, Position = positionOffset.Value, }; circle.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty { CircleSize = circleSize }); var drawable = new TestDrawableHitCircle(circle, auto) { Anchor = Anchor.Centre, Depth = depthIndex++ }; foreach (var mod in Mods.Value.OfType <IApplicableToDrawableHitObjects>()) { mod.ApplyToDrawableHitObjects(new[] { drawable }); } Add(drawable); }
public override void ApplyToBeatmap(IBeatmap beatmap) { Seed.Value ??= RNG.Next(); rng = new Random(Seed.Value.Value); var osuBeatmap = (OsuBeatmap)beatmap; if (osuBeatmap.HitObjects.Count == 0) { return; } controlPointInfo = osuBeatmap.ControlPointInfo; originalHitObjects = osuBeatmap.HitObjects.OrderBy(x => x.StartTime).ToList(); var hitObjects = generateBeats(osuBeatmap) .Select(beat => { var newCircle = new HitCircle(); newCircle.ApplyDefaults(controlPointInfo, osuBeatmap.Difficulty); newCircle.StartTime = beat; return((OsuHitObject)newCircle); }).ToList(); addHitSamples(hitObjects); fixComboInfo(hitObjects); randomizeCirclePos(hitObjects); osuBeatmap.HitObjects = hitObjects; base.ApplyToBeatmap(beatmap); }
public TestCaseHitCircleSelectionBlueprint() { var hitCircle = new HitCircle { Position = new Vector2(256, 192) }; hitCircle.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty { CircleSize = 2 }); Add(drawableObject = new DrawableHitCircle(hitCircle)); }
public void Setup() => Schedule(() => { Clear(); hitCircle = new HitCircle { Position = new Vector2(256, 192) }; hitCircle.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty { CircleSize = 2 }); Add(drawableObject = new DrawableHitCircle(hitCircle)); AddBlueprint(blueprint = new TestBlueprint(hitCircle), drawableObject); });
public void TestMutedControlPointVolume() { var hitcircle = new HitCircle { StartTime = 2000, Samples = new List <HitSampleInfo> { new HitSampleInfo(HitSampleInfo.HIT_NORMAL) } }; hitcircle.ApplyDefaults(cpi, new BeatmapDifficulty()); assertMuted(new List <HitObject> { hitcircle }); }
public void TestLowSampleVolume() { var hitcircle = new HitCircle { StartTime = 2000, Samples = new List <HitSampleInfo> { new HitSampleInfo(HitSampleInfo.HIT_NORMAL, volume: volume_low) } }; hitcircle.ApplyDefaults(cpi, new BeatmapDifficulty()); assertLowVolume(new List <HitObject> { hitcircle }); }
public void TestNormalSampleVolume() { // The sample volume should take precedence over the control point volume. var hitcircle = new HitCircle { StartTime = 2000, Samples = new List <HitSampleInfo> { new HitSampleInfo(HitSampleInfo.HIT_NORMAL, volume: volume_regular) } }; hitcircle.ApplyDefaults(cpi, new BeatmapDifficulty()); assertOk(new List <HitObject> { hitcircle }); }
private void addHitCircle() { var hitCircle = new HitCircle { StartTime = Time.Current + 1000, Position = new Vector2(0, 0), }; hitCircle.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty { CircleSize = 2 }); Add(new TestDrawableHitCircle(hitCircle, true) { Anchor = Anchor.Centre, Origin = Anchor.Centre, }); }
public void SetUp() => Schedule(() => { hitCircle = new HitCircle { Position = new Vector2(100, 100), StartTime = Time.Current + 500 }; hitCircle.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty()); Child = new SkinProvidingContainer(new DefaultSkin(null)) { RelativeSizeAxes = Axes.Both, Child = drawableHitCircle = new DrawableHitCircle(hitCircle) { Size = new Vector2(100) } }; });
private void load() { var playfield = new OsuEditPlayfield(); Children = new Drawable[] { new Container { RelativeSizeAxes = Axes.Both, Clock = new FramedClock(new StopwatchClock()), Child = playfield }, new SelectionLayer(playfield) }; var hitCircle1 = new HitCircle { Position = new Vector2(256, 192), Scale = 0.5f }; var hitCircle2 = new HitCircle { Position = new Vector2(344, 148), Scale = 0.5f }; var slider = new Slider { ControlPoints = new List <Vector2> { new Vector2(128, 256), new Vector2(344, 256), }, Distance = 400, Position = new Vector2(128, 256), Velocity = 1, TickDistance = 100, Scale = 0.5f, }; hitCircle1.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty()); hitCircle2.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty()); slider.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty()); playfield.Add(new DrawableHitCircle(hitCircle1)); playfield.Add(new DrawableHitCircle(hitCircle2)); playfield.Add(new DrawableSlider(slider)); }
private TestDrawableHitCircle createSingle(float circleSize, bool auto, double timeOffset, Vector2?positionOffset, double hitOffset = 0) { positionOffset ??= Vector2.Zero; var circle = new HitCircle { StartTime = Time.Current + 1000 + timeOffset, Position = OsuPlayfield.BASE_SIZE / 4 + positionOffset.Value, }; circle.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty { CircleSize = circleSize }); var drawable = CreateDrawableHitCircle(circle, auto, hitOffset); foreach (var mod in SelectedMods.Value.OfType <IApplicableToDrawableHitObject>()) { mod.ApplyToDrawableHitObject(drawable); } return(drawable); }
private Drawable testSingle(float circleSize, bool auto = false, double timeOffset = 0, Vector2?positionOffset = null) { positionOffset ??= Vector2.Zero; var circle = new HitCircle { StartTime = Time.Current + 1000 + timeOffset, Position = positionOffset.Value, }; circle.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty { CircleSize = circleSize }); var drawable = CreateDrawableHitCircle(circle, auto); foreach (var mod in SelectedMods.Value.OfType <IApplicableToDrawableHitObjects>()) { mod.ApplyToDrawableHitObjects(new[] { drawable }); } return(drawable); }
private HitCircle prepareObject(HitCircle circle) { circle.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty()); return(circle); }