mirror of
https://github.com/ppy/osu.git
synced 2025-01-07 21:32:57 +08:00
commit
24837a0af3
95
osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs
Normal file
95
osu.Desktop.VisualTests/Tests/TestCaseGamefield.cs
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using OpenTK;
|
||||||
|
using osu.Framework.GameModes.Testing;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.MathUtils;
|
||||||
|
using osu.Game.Beatmaps;
|
||||||
|
using osu.Game.Beatmaps.Objects;
|
||||||
|
using osu.Game.Beatmaps.Objects.Osu;
|
||||||
|
using osu.Game.GameModes.Play.Catch;
|
||||||
|
using osu.Game.GameModes.Play.Mania;
|
||||||
|
using osu.Game.GameModes.Play.Osu;
|
||||||
|
using osu.Game.GameModes.Play.Taiko;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using osu.Framework.Timing;
|
||||||
|
|
||||||
|
namespace osu.Desktop.Tests
|
||||||
|
{
|
||||||
|
class TestCaseGamefield : TestCase
|
||||||
|
{
|
||||||
|
public override string Name => @"Gamefield";
|
||||||
|
|
||||||
|
public override string Description => @"Showing hitobjects and what not.";
|
||||||
|
|
||||||
|
FramedOffsetClock localClock;
|
||||||
|
|
||||||
|
protected override IFrameBasedClock Clock => localClock;
|
||||||
|
|
||||||
|
public override void Reset()
|
||||||
|
{
|
||||||
|
base.Reset();
|
||||||
|
|
||||||
|
///create a new clock offset to 0.
|
||||||
|
localClock = new FramedOffsetClock(base.Clock) { Offset = -base.Clock.CurrentTime };
|
||||||
|
|
||||||
|
List<HitObject> objects = new List<HitObject>();
|
||||||
|
|
||||||
|
int time = 500;
|
||||||
|
for (int i = 0; i < 100; i++)
|
||||||
|
{
|
||||||
|
objects.Add(new Circle()
|
||||||
|
{
|
||||||
|
StartTime = time,
|
||||||
|
Position = new Vector2(RNG.Next(0, 512), RNG.Next(0, 384))
|
||||||
|
});
|
||||||
|
|
||||||
|
time += RNG.Next(50, 500);
|
||||||
|
}
|
||||||
|
|
||||||
|
Beatmap beatmap = new Beatmap
|
||||||
|
{
|
||||||
|
HitObjects = objects
|
||||||
|
};
|
||||||
|
|
||||||
|
Add(new Drawable[]
|
||||||
|
{
|
||||||
|
new OsuHitRenderer
|
||||||
|
{
|
||||||
|
Objects = beatmap.HitObjects,
|
||||||
|
Scale = new Vector2(0.5f),
|
||||||
|
Anchor = Anchor.TopLeft,
|
||||||
|
Origin = Anchor.TopLeft
|
||||||
|
},
|
||||||
|
new TaikoHitRenderer
|
||||||
|
{
|
||||||
|
Objects = beatmap.HitObjects,
|
||||||
|
Scale = new Vector2(0.5f),
|
||||||
|
Anchor = Anchor.TopRight,
|
||||||
|
Origin = Anchor.TopRight
|
||||||
|
},
|
||||||
|
new CatchHitRenderer
|
||||||
|
{
|
||||||
|
Objects = beatmap.HitObjects,
|
||||||
|
Scale = new Vector2(0.5f),
|
||||||
|
Anchor = Anchor.BottomLeft,
|
||||||
|
Origin = Anchor.BottomLeft
|
||||||
|
},
|
||||||
|
new ManiaHitRenderer
|
||||||
|
{
|
||||||
|
Objects = beatmap.HitObjects,
|
||||||
|
Scale = new Vector2(0.5f),
|
||||||
|
Anchor = Anchor.BottomRight,
|
||||||
|
Origin = Anchor.BottomRight
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Update()
|
||||||
|
{
|
||||||
|
base.Update();
|
||||||
|
localClock.ProcessFrame();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -150,6 +150,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="Program.cs" />
|
<Compile Include="Program.cs" />
|
||||||
|
<Compile Include="Tests\TestCaseGamefield.cs" />
|
||||||
<Compile Include="Tests\TestCaseKeyCounter.cs" />
|
<Compile Include="Tests\TestCaseKeyCounter.cs" />
|
||||||
<Compile Include="Tests\TestCaseMenuButtonSystem.cs" />
|
<Compile Include="Tests\TestCaseMenuButtonSystem.cs" />
|
||||||
<Compile Include="Tests\TestCaseTextAwesome.cs" />
|
<Compile Include="Tests\TestCaseTextAwesome.cs" />
|
||||||
|
20
osu.Game/Beatmaps/Beatmap.cs
Normal file
20
osu.Game/Beatmaps/Beatmap.cs
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
//Copyright (c) 2007-2016 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.Objects;
|
||||||
|
using osu.Game.Beatmaps.Timing;
|
||||||
|
using osu.Game.Users;
|
||||||
|
|
||||||
|
namespace osu.Game.Beatmaps
|
||||||
|
{
|
||||||
|
public class Beatmap
|
||||||
|
{
|
||||||
|
public List<HitObject> HitObjects;
|
||||||
|
|
||||||
|
public List<ControlPoint> ControlPoints;
|
||||||
|
|
||||||
|
public string Difficulty;
|
||||||
|
public User Creator;
|
||||||
|
}
|
||||||
|
}
|
20
osu.Game/Beatmaps/BeatmapSet.cs
Normal file
20
osu.Game/Beatmaps/BeatmapSet.cs
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
//Copyright (c) 2007-2016 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.Users;
|
||||||
|
|
||||||
|
namespace osu.Game.Beatmaps
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// A beatmap set contains multiple beatmap (difficulties).
|
||||||
|
/// </summary>
|
||||||
|
public class BeatmapSet
|
||||||
|
{
|
||||||
|
public List<Beatmap> Beatmaps { get; protected set; }
|
||||||
|
|
||||||
|
public Metadata Metadata;
|
||||||
|
|
||||||
|
public User Creator;
|
||||||
|
}
|
||||||
|
}
|
11
osu.Game/Beatmaps/Metadata.cs
Normal file
11
osu.Game/Beatmaps/Metadata.cs
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
namespace osu.Game.Beatmaps
|
||||||
|
{
|
||||||
|
public class Metadata
|
||||||
|
{
|
||||||
|
public string Artist;
|
||||||
|
public string Title;
|
||||||
|
}
|
||||||
|
}
|
10
osu.Game/Beatmaps/Objects/Catch/CatchBaseHit.cs
Normal file
10
osu.Game/Beatmaps/Objects/Catch/CatchBaseHit.cs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
namespace osu.Game.Beatmaps.Objects.Catch
|
||||||
|
{
|
||||||
|
public abstract class CatchBaseHit : HitObject
|
||||||
|
{
|
||||||
|
public float Position;
|
||||||
|
}
|
||||||
|
}
|
9
osu.Game/Beatmaps/Objects/Catch/Droplet.cs
Normal file
9
osu.Game/Beatmaps/Objects/Catch/Droplet.cs
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
namespace osu.Game.Beatmaps.Objects.Catch
|
||||||
|
{
|
||||||
|
public class Droplet : CatchBaseHit
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
9
osu.Game/Beatmaps/Objects/Catch/Fruit.cs
Normal file
9
osu.Game/Beatmaps/Objects/Catch/Fruit.cs
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
namespace osu.Game.Beatmaps.Objects.Catch
|
||||||
|
{
|
||||||
|
public class Fruit : CatchBaseHit
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
20
osu.Game/Beatmaps/Objects/HitObject.cs
Normal file
20
osu.Game/Beatmaps/Objects/HitObject.cs
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using osu.Game.Beatmaps.Samples;
|
||||||
|
|
||||||
|
namespace osu.Game.Beatmaps.Objects
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// A hitobject describes a point in a beatmap
|
||||||
|
/// </summary>
|
||||||
|
public abstract class HitObject
|
||||||
|
{
|
||||||
|
public double StartTime;
|
||||||
|
public double? EndTime;
|
||||||
|
|
||||||
|
public double Duration => (EndTime ?? StartTime) - StartTime;
|
||||||
|
|
||||||
|
public HitSampleInfo Sample;
|
||||||
|
}
|
||||||
|
}
|
9
osu.Game/Beatmaps/Objects/Mania/HoldNote.cs
Normal file
9
osu.Game/Beatmaps/Objects/Mania/HoldNote.cs
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
namespace osu.Game.Beatmaps.Objects.Mania
|
||||||
|
{
|
||||||
|
public class HoldNote : Note
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
10
osu.Game/Beatmaps/Objects/Mania/ManiaBaseHit.cs
Normal file
10
osu.Game/Beatmaps/Objects/Mania/ManiaBaseHit.cs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
namespace osu.Game.Beatmaps.Objects.Mania
|
||||||
|
{
|
||||||
|
public abstract class ManiaBaseHit : HitObject
|
||||||
|
{
|
||||||
|
public int Column;
|
||||||
|
}
|
||||||
|
}
|
9
osu.Game/Beatmaps/Objects/Mania/Note.cs
Normal file
9
osu.Game/Beatmaps/Objects/Mania/Note.cs
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
namespace osu.Game.Beatmaps.Objects.Mania
|
||||||
|
{
|
||||||
|
public class Note : ManiaBaseHit
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
9
osu.Game/Beatmaps/Objects/Osu/Circle.cs
Normal file
9
osu.Game/Beatmaps/Objects/Osu/Circle.cs
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
namespace osu.Game.Beatmaps.Objects.Osu
|
||||||
|
{
|
||||||
|
public class Circle : OsuBaseHit
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
12
osu.Game/Beatmaps/Objects/Osu/OsuBaseHit.cs
Normal file
12
osu.Game/Beatmaps/Objects/Osu/OsuBaseHit.cs
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using OpenTK;
|
||||||
|
|
||||||
|
namespace osu.Game.Beatmaps.Objects.Osu
|
||||||
|
{
|
||||||
|
public abstract class OsuBaseHit : HitObject
|
||||||
|
{
|
||||||
|
public Vector2 Position;
|
||||||
|
}
|
||||||
|
}
|
15
osu.Game/Beatmaps/Objects/Osu/Slider.cs
Normal file
15
osu.Game/Beatmaps/Objects/Osu/Slider.cs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using OpenTK;
|
||||||
|
|
||||||
|
namespace osu.Game.Beatmaps.Objects.Osu
|
||||||
|
{
|
||||||
|
public class Slider : OsuBaseHit
|
||||||
|
{
|
||||||
|
public List<Vector2> Path;
|
||||||
|
|
||||||
|
public int RepeatCount;
|
||||||
|
}
|
||||||
|
}
|
9
osu.Game/Beatmaps/Objects/Osu/Spinner.cs
Normal file
9
osu.Game/Beatmaps/Objects/Osu/Spinner.cs
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
namespace osu.Game.Beatmaps.Objects.Osu
|
||||||
|
{
|
||||||
|
public class Spinner
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
18
osu.Game/Beatmaps/Objects/Taiko/TaikoBaseHit.cs
Normal file
18
osu.Game/Beatmaps/Objects/Taiko/TaikoBaseHit.cs
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
namespace osu.Game.Beatmaps.Objects.Taiko
|
||||||
|
{
|
||||||
|
class TaikoBaseHit : HitObject
|
||||||
|
{
|
||||||
|
public float Scale = 1;
|
||||||
|
|
||||||
|
public TaikoColour Type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum TaikoColour
|
||||||
|
{
|
||||||
|
Red,
|
||||||
|
Blue
|
||||||
|
}
|
||||||
|
}
|
10
osu.Game/Beatmaps/Samples/HitSampleInfo.cs
Normal file
10
osu.Game/Beatmaps/Samples/HitSampleInfo.cs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
namespace osu.Game.Beatmaps.Samples
|
||||||
|
{
|
||||||
|
public class HitSampleInfo : SampleInfo
|
||||||
|
{
|
||||||
|
SampleType Type;
|
||||||
|
}
|
||||||
|
}
|
12
osu.Game/Beatmaps/Samples/SampleBank.cs
Normal file
12
osu.Game/Beatmaps/Samples/SampleBank.cs
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
namespace osu.Game.Beatmaps.Samples
|
||||||
|
{
|
||||||
|
public enum SampleBank
|
||||||
|
{
|
||||||
|
Default = 0,
|
||||||
|
Custom1 = 1,
|
||||||
|
Custom2 = 2
|
||||||
|
}
|
||||||
|
}
|
11
osu.Game/Beatmaps/Samples/SampleInfo.cs
Normal file
11
osu.Game/Beatmaps/Samples/SampleInfo.cs
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
namespace osu.Game.Beatmaps.Samples
|
||||||
|
{
|
||||||
|
public class SampleInfo
|
||||||
|
{
|
||||||
|
public SampleBank Bank;
|
||||||
|
public SampleSet Set;
|
||||||
|
}
|
||||||
|
}
|
13
osu.Game/Beatmaps/Samples/SampleSet.cs
Normal file
13
osu.Game/Beatmaps/Samples/SampleSet.cs
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
namespace osu.Game.Beatmaps.Samples
|
||||||
|
{
|
||||||
|
public enum SampleSet
|
||||||
|
{
|
||||||
|
None = 0,
|
||||||
|
Normal = 1,
|
||||||
|
Soft = 2,
|
||||||
|
Drum = 3
|
||||||
|
}
|
||||||
|
}
|
17
osu.Game/Beatmaps/Samples/SampleType.cs
Normal file
17
osu.Game/Beatmaps/Samples/SampleType.cs
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace osu.Game.Beatmaps.Samples
|
||||||
|
{
|
||||||
|
[Flags]
|
||||||
|
public enum SampleType
|
||||||
|
{
|
||||||
|
None = 0,
|
||||||
|
Normal = 1,
|
||||||
|
Whistle = 2,
|
||||||
|
Finish = 4,
|
||||||
|
Clap = 8
|
||||||
|
};
|
||||||
|
}
|
16
osu.Game/Beatmaps/Timing/ControlPoint.cs
Normal file
16
osu.Game/Beatmaps/Timing/ControlPoint.cs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace osu.Game.Beatmaps.Timing
|
||||||
|
{
|
||||||
|
public class ControlPoint
|
||||||
|
{
|
||||||
|
public double Time;
|
||||||
|
}
|
||||||
|
}
|
17
osu.Game/Beatmaps/Timing/SampleChange.cs
Normal file
17
osu.Game/Beatmaps/Timing/SampleChange.cs
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using osu.Game.Beatmaps.Samples;
|
||||||
|
|
||||||
|
namespace osu.Game.Beatmaps.Timing
|
||||||
|
{
|
||||||
|
class SampleChange : ControlPoint
|
||||||
|
{
|
||||||
|
public SampleInfo Sample;
|
||||||
|
}
|
||||||
|
}
|
18
osu.Game/Beatmaps/Timing/TimingChange.cs
Normal file
18
osu.Game/Beatmaps/Timing/TimingChange.cs
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace osu.Game.Beatmaps.Timing
|
||||||
|
{
|
||||||
|
class TimingChange : ControlPoint
|
||||||
|
{
|
||||||
|
public double BeatLength;
|
||||||
|
|
||||||
|
public double BPM => 60000 / BeatLength;
|
||||||
|
}
|
||||||
|
}
|
84
osu.Game/GameModes/Play/Catch/CatchHitRenderer.cs
Normal file
84
osu.Game/GameModes/Play/Catch/CatchHitRenderer.cs
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using osu.Framework.Graphics.Sprites;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Transformations;
|
||||||
|
using osu.Game.Beatmaps.Objects;
|
||||||
|
using osu.Game.Beatmaps.Objects.Osu;
|
||||||
|
using osu.Game.Beatmaps.Objects.Catch;
|
||||||
|
using OpenTK;
|
||||||
|
|
||||||
|
namespace osu.Game.GameModes.Play.Catch
|
||||||
|
{
|
||||||
|
public class CatchHitRenderer : HitRenderer
|
||||||
|
{
|
||||||
|
List<CatchBaseHit> objects;
|
||||||
|
private CatchPlayfield playfield;
|
||||||
|
|
||||||
|
public override List<HitObject> Objects
|
||||||
|
{
|
||||||
|
set
|
||||||
|
{
|
||||||
|
//osu! mode requires all objects to be of CatchBaseHit type.
|
||||||
|
objects = value.ConvertAll(convertForCatch);
|
||||||
|
|
||||||
|
if (Parent != null)
|
||||||
|
Load();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private CatchBaseHit convertForCatch(HitObject input)
|
||||||
|
{
|
||||||
|
CatchBaseHit h = input as CatchBaseHit;
|
||||||
|
|
||||||
|
if (h == null)
|
||||||
|
{
|
||||||
|
OsuBaseHit o = input as OsuBaseHit;
|
||||||
|
|
||||||
|
if (o == null) throw new Exception(@"Can't convert!");
|
||||||
|
|
||||||
|
h = new Fruit()
|
||||||
|
{
|
||||||
|
StartTime = o.StartTime,
|
||||||
|
Position = o.Position.X
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return h;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Load()
|
||||||
|
{
|
||||||
|
base.Load();
|
||||||
|
|
||||||
|
if (playfield == null)
|
||||||
|
Add(playfield = new CatchPlayfield());
|
||||||
|
else
|
||||||
|
playfield.Clear();
|
||||||
|
|
||||||
|
if (objects == null) return;
|
||||||
|
|
||||||
|
foreach (CatchBaseHit h in objects)
|
||||||
|
{
|
||||||
|
//render stuff!
|
||||||
|
Sprite s = new Sprite
|
||||||
|
{
|
||||||
|
Texture = Game.Textures.Get(@"menu-osu"),
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
Scale = new Vector2(0.1f),
|
||||||
|
PositionMode = InheritMode.Y,
|
||||||
|
Position = new Vector2(h.Position, -0.1f)
|
||||||
|
};
|
||||||
|
|
||||||
|
s.Transforms.Add(new TransformPosition(Clock) { StartTime = h.StartTime - 200, EndTime = h.StartTime, StartValue = new Vector2(h.Position, -0.1f), EndValue = new Vector2(h.Position, 0.9f) });
|
||||||
|
s.Transforms.Add(new TransformAlpha(Clock) { StartTime = h.StartTime + h.Duration + 200, EndTime = h.StartTime + h.Duration + 400, StartValue = 1, EndValue = 0 });
|
||||||
|
s.Expire(true);
|
||||||
|
|
||||||
|
playfield.Add(s);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
30
osu.Game/GameModes/Play/Catch/CatchPlayfield.cs
Normal file
30
osu.Game/GameModes/Play/Catch/CatchPlayfield.cs
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Drawables;
|
||||||
|
using osu.Framework.Graphics.Sprites;
|
||||||
|
using OpenTK;
|
||||||
|
using OpenTK.Graphics;
|
||||||
|
|
||||||
|
namespace osu.Game.GameModes.Play.Catch
|
||||||
|
{
|
||||||
|
public class CatchPlayfield : Playfield
|
||||||
|
{
|
||||||
|
public CatchPlayfield()
|
||||||
|
{
|
||||||
|
SizeMode = InheritMode.Y;
|
||||||
|
Size = new Vector2(512, 0.9f);
|
||||||
|
Anchor = Anchor.BottomCentre;
|
||||||
|
Origin = Anchor.BottomCentre;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Load()
|
||||||
|
{
|
||||||
|
base.Load();
|
||||||
|
|
||||||
|
Add(new Box { SizeMode = InheritMode.XY, Alpha = 0.5f });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
25
osu.Game/GameModes/Play/HitRenderer.cs
Normal file
25
osu.Game/GameModes/Play/HitRenderer.cs
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
//Copyright (c) 2007-2016 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.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Batches;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Drawables;
|
||||||
|
using osu.Game.Beatmaps.Objects;
|
||||||
|
using OpenTK;
|
||||||
|
|
||||||
|
namespace osu.Game.GameModes.Play
|
||||||
|
{
|
||||||
|
public abstract class HitRenderer : LargeContainer
|
||||||
|
{
|
||||||
|
public abstract List<HitObject> Objects { set; }
|
||||||
|
|
||||||
|
public override void Load()
|
||||||
|
{
|
||||||
|
base.Load();
|
||||||
|
|
||||||
|
Add(new Box() { SizeMode = InheritMode.XY, Alpha = 0.1f, Scale = new Vector2(0.99f) });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
90
osu.Game/GameModes/Play/Mania/ManiaHitRenderer.cs
Normal file
90
osu.Game/GameModes/Play/Mania/ManiaHitRenderer.cs
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using osu.Framework.Graphics.Sprites;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Transformations;
|
||||||
|
using osu.Game.Beatmaps.Objects;
|
||||||
|
using osu.Game.Beatmaps.Objects.Osu;
|
||||||
|
using osu.Game.Beatmaps.Objects.Mania;
|
||||||
|
using OpenTK;
|
||||||
|
|
||||||
|
namespace osu.Game.GameModes.Play.Mania
|
||||||
|
{
|
||||||
|
public class ManiaHitRenderer : HitRenderer
|
||||||
|
{
|
||||||
|
private readonly int columns;
|
||||||
|
List<ManiaBaseHit> objects;
|
||||||
|
private ManiaPlayfield playfield;
|
||||||
|
|
||||||
|
public ManiaHitRenderer(int columns = 5)
|
||||||
|
{
|
||||||
|
this.columns = columns;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override List<HitObject> Objects
|
||||||
|
{
|
||||||
|
set
|
||||||
|
{
|
||||||
|
//osu! mode requires all objects to be of ManiaBaseHit type.
|
||||||
|
objects = value.ConvertAll(convertForMania);
|
||||||
|
|
||||||
|
if (Parent != null)
|
||||||
|
Load();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private ManiaBaseHit convertForMania(HitObject input)
|
||||||
|
{
|
||||||
|
ManiaBaseHit h = input as ManiaBaseHit;
|
||||||
|
|
||||||
|
if (h == null)
|
||||||
|
{
|
||||||
|
OsuBaseHit o = input as OsuBaseHit;
|
||||||
|
|
||||||
|
if (o == null) throw new Exception(@"Can't convert!");
|
||||||
|
|
||||||
|
h = new Note()
|
||||||
|
{
|
||||||
|
StartTime = o.StartTime,
|
||||||
|
Column = (int)Math.Round(o.Position.X / 512 * columns)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return h;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Load()
|
||||||
|
{
|
||||||
|
base.Load();
|
||||||
|
|
||||||
|
if (playfield == null)
|
||||||
|
Add(playfield = new ManiaPlayfield(columns));
|
||||||
|
else
|
||||||
|
playfield.Clear();
|
||||||
|
|
||||||
|
if (objects == null) return;
|
||||||
|
|
||||||
|
foreach (ManiaBaseHit h in objects)
|
||||||
|
{
|
||||||
|
//render stuff!
|
||||||
|
Sprite s = new Sprite
|
||||||
|
{
|
||||||
|
Texture = Game.Textures.Get(@"menu-osu"),
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
Scale = new Vector2(0.1f),
|
||||||
|
PositionMode = InheritMode.XY,
|
||||||
|
Position = new Vector2((float)(h.Column + 0.5) / columns, -0.1f)
|
||||||
|
};
|
||||||
|
|
||||||
|
s.Transforms.Add(new TransformPositionY(Clock) { StartTime = h.StartTime - 200, EndTime = h.StartTime, StartValue = -0.1f, EndValue = 0.9f });
|
||||||
|
s.Transforms.Add(new TransformAlpha(Clock) { StartTime = h.StartTime + h.Duration + 200, EndTime = h.StartTime + h.Duration + 400, StartValue = 1, EndValue = 0 });
|
||||||
|
s.Expire(true);
|
||||||
|
|
||||||
|
playfield.Add(s);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
44
osu.Game/GameModes/Play/Mania/ManiaPlayfield.cs
Normal file
44
osu.Game/GameModes/Play/Mania/ManiaPlayfield.cs
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Drawables;
|
||||||
|
using osu.Framework.Graphics.Sprites;
|
||||||
|
using OpenTK;
|
||||||
|
using OpenTK.Graphics;
|
||||||
|
|
||||||
|
namespace osu.Game.GameModes.Play.Mania
|
||||||
|
{
|
||||||
|
public class ManiaPlayfield : Playfield
|
||||||
|
{
|
||||||
|
private readonly int columns;
|
||||||
|
|
||||||
|
public ManiaPlayfield(int columns)
|
||||||
|
{
|
||||||
|
this.columns = columns;
|
||||||
|
SizeMode = InheritMode.XY;
|
||||||
|
Size = new Vector2(columns / 20f, 1f);
|
||||||
|
Anchor = Anchor.BottomCentre;
|
||||||
|
Origin = Anchor.BottomCentre;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Load()
|
||||||
|
{
|
||||||
|
base.Load();
|
||||||
|
|
||||||
|
Add(new Box() { SizeMode = InheritMode.XY, Alpha = 0.5f });
|
||||||
|
|
||||||
|
for (int i = 0; i < columns; i++)
|
||||||
|
Add(new Box()
|
||||||
|
{
|
||||||
|
SizeMode = InheritMode.Y,
|
||||||
|
Size = new Vector2(2, 1),
|
||||||
|
PositionMode = InheritMode.XY,
|
||||||
|
Position = new Vector2((float)i / columns, 0),
|
||||||
|
Alpha = 0.5f,
|
||||||
|
Colour = Color4.Black
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
62
osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs
Normal file
62
osu.Game/GameModes/Play/Osu/OsuHitRenderer.cs
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
//Copyright (c) 2007-2016 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.Framework.Graphics.Sprites;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Transformations;
|
||||||
|
using osu.Game.Beatmaps.Objects;
|
||||||
|
using osu.Game.Beatmaps.Objects.Osu;
|
||||||
|
using OpenTK;
|
||||||
|
|
||||||
|
namespace osu.Game.GameModes.Play.Osu
|
||||||
|
{
|
||||||
|
public class OsuHitRenderer : HitRenderer
|
||||||
|
{
|
||||||
|
List<OsuBaseHit> objects;
|
||||||
|
private OsuPlayfield playfield;
|
||||||
|
|
||||||
|
public override List<HitObject> Objects
|
||||||
|
{
|
||||||
|
set
|
||||||
|
{
|
||||||
|
//osu! mode requires all objects to be of OsuBaseHit type.
|
||||||
|
objects = value.ConvertAll(o => (OsuBaseHit)o);
|
||||||
|
|
||||||
|
if (Parent != null)
|
||||||
|
Load();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Load()
|
||||||
|
{
|
||||||
|
base.Load();
|
||||||
|
|
||||||
|
if (playfield == null)
|
||||||
|
Add(playfield = new OsuPlayfield());
|
||||||
|
else
|
||||||
|
playfield.Clear();
|
||||||
|
|
||||||
|
if (objects == null) return;
|
||||||
|
|
||||||
|
foreach (OsuBaseHit h in objects)
|
||||||
|
{
|
||||||
|
//render stuff!
|
||||||
|
Sprite s = new Sprite
|
||||||
|
{
|
||||||
|
Texture = Game.Textures.Get(@"menu-osu"),
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
Scale = new Vector2(0.1f),
|
||||||
|
Alpha = 0,
|
||||||
|
Position = h.Position
|
||||||
|
};
|
||||||
|
|
||||||
|
s.Transforms.Add(new TransformAlpha(Clock) { StartTime = h.StartTime - 200, EndTime = h.StartTime, StartValue = 0, EndValue = 1 });
|
||||||
|
s.Transforms.Add(new TransformAlpha(Clock) { StartTime = h.StartTime + h.Duration + 200, EndTime = h.StartTime + h.Duration + 400, StartValue = 1, EndValue = 0 });
|
||||||
|
s.Expire(true);
|
||||||
|
|
||||||
|
playfield.Add(s);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
34
osu.Game/GameModes/Play/Osu/OsuPlayfield.cs
Normal file
34
osu.Game/GameModes/Play/Osu/OsuPlayfield.cs
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Drawables;
|
||||||
|
using OpenTK;
|
||||||
|
|
||||||
|
namespace osu.Game.GameModes.Play.Osu
|
||||||
|
{
|
||||||
|
public class OsuPlayfield : Playfield
|
||||||
|
{
|
||||||
|
public OsuPlayfield()
|
||||||
|
{
|
||||||
|
SizeMode = InheritMode.None;
|
||||||
|
Size = new Vector2(512, 384);
|
||||||
|
Anchor = Anchor.Centre;
|
||||||
|
Origin = Anchor.Centre;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Load()
|
||||||
|
{
|
||||||
|
base.Load();
|
||||||
|
|
||||||
|
Add(new Box()
|
||||||
|
{
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
SizeMode = InheritMode.XY,
|
||||||
|
Alpha = 0.5f
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
17
osu.Game/GameModes/Play/Playfield.cs
Normal file
17
osu.Game/GameModes/Play/Playfield.cs
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
|
||||||
|
namespace osu.Game.GameModes.Play
|
||||||
|
{
|
||||||
|
public class Playfield : Container
|
||||||
|
{
|
||||||
|
public override void Load()
|
||||||
|
{
|
||||||
|
base.Load();
|
||||||
|
|
||||||
|
Masking = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
83
osu.Game/GameModes/Play/Taiko/TaikoHitRenderer.cs
Normal file
83
osu.Game/GameModes/Play/Taiko/TaikoHitRenderer.cs
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using osu.Framework.Graphics.Sprites;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Transformations;
|
||||||
|
using osu.Game.Beatmaps.Objects;
|
||||||
|
using osu.Game.Beatmaps.Objects.Osu;
|
||||||
|
using osu.Game.Beatmaps.Objects.Taiko;
|
||||||
|
using OpenTK;
|
||||||
|
|
||||||
|
namespace osu.Game.GameModes.Play.Taiko
|
||||||
|
{
|
||||||
|
public class TaikoHitRenderer : HitRenderer
|
||||||
|
{
|
||||||
|
List<TaikoBaseHit> objects;
|
||||||
|
private TaikoPlayfield playfield;
|
||||||
|
|
||||||
|
public override List<HitObject> Objects
|
||||||
|
{
|
||||||
|
set
|
||||||
|
{
|
||||||
|
//osu! mode requires all objects to be of TaikoBaseHit type.
|
||||||
|
objects = value.ConvertAll(convertForTaiko);
|
||||||
|
|
||||||
|
if (Parent != null)
|
||||||
|
Load();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private TaikoBaseHit convertForTaiko(HitObject input)
|
||||||
|
{
|
||||||
|
TaikoBaseHit h = input as TaikoBaseHit;
|
||||||
|
|
||||||
|
if (h == null)
|
||||||
|
{
|
||||||
|
OsuBaseHit o = input as OsuBaseHit;
|
||||||
|
|
||||||
|
if (o == null) throw new Exception(@"Can't convert!");
|
||||||
|
|
||||||
|
h = new TaikoBaseHit()
|
||||||
|
{
|
||||||
|
StartTime = o.StartTime
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return h;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Load()
|
||||||
|
{
|
||||||
|
base.Load();
|
||||||
|
|
||||||
|
if (playfield == null)
|
||||||
|
Add(playfield = new TaikoPlayfield());
|
||||||
|
else
|
||||||
|
playfield.Clear();
|
||||||
|
|
||||||
|
if (objects == null) return;
|
||||||
|
|
||||||
|
foreach (TaikoBaseHit h in objects)
|
||||||
|
{
|
||||||
|
//render stuff!
|
||||||
|
Sprite s = new Sprite
|
||||||
|
{
|
||||||
|
Texture = Game.Textures.Get(@"menu-osu"),
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
Scale = new Vector2(0.2f),
|
||||||
|
PositionMode = InheritMode.XY,
|
||||||
|
Position = new Vector2(1.1f, 0.5f)
|
||||||
|
};
|
||||||
|
|
||||||
|
s.Transforms.Add(new TransformPositionX(Clock) { StartTime = h.StartTime - 200, EndTime = h.StartTime, StartValue = 1.1f, EndValue = 0.1f });
|
||||||
|
s.Transforms.Add(new TransformAlpha(Clock) { StartTime = h.StartTime + h.Duration + 200, EndTime = h.StartTime + h.Duration + 400, StartValue = 1, EndValue = 0 });
|
||||||
|
s.Expire(true);
|
||||||
|
|
||||||
|
playfield.Add(s);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
40
osu.Game/GameModes/Play/Taiko/TaikoPlayfield.cs
Normal file
40
osu.Game/GameModes/Play/Taiko/TaikoPlayfield.cs
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Drawables;
|
||||||
|
using osu.Framework.Graphics.Sprites;
|
||||||
|
using OpenTK;
|
||||||
|
using OpenTK.Graphics;
|
||||||
|
|
||||||
|
namespace osu.Game.GameModes.Play.Taiko
|
||||||
|
{
|
||||||
|
public class TaikoPlayfield : Playfield
|
||||||
|
{
|
||||||
|
public TaikoPlayfield()
|
||||||
|
{
|
||||||
|
SizeMode = InheritMode.X;
|
||||||
|
Size = new Vector2(1, 100);
|
||||||
|
Anchor = Anchor.Centre;
|
||||||
|
Origin = Anchor.Centre;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Load()
|
||||||
|
{
|
||||||
|
base.Load();
|
||||||
|
|
||||||
|
Add(new Box { SizeMode = InheritMode.XY, Alpha = 0.5f });
|
||||||
|
|
||||||
|
Add(new Sprite
|
||||||
|
{
|
||||||
|
Texture = Game.Textures.Get(@"menu-osu"),
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
Scale = new Vector2(0.2f),
|
||||||
|
PositionMode = InheritMode.XY,
|
||||||
|
Position = new Vector2(0.1f, 0.5f),
|
||||||
|
Colour = Color4.Gray
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
28
osu.Game/Graphics/Components/FpsDisplay.cs
Normal file
28
osu.Game/Graphics/Components/FpsDisplay.cs
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Sprites;
|
||||||
|
using osu.Game.Graphics.Containers;
|
||||||
|
|
||||||
|
namespace osu.Game.Graphics.Components
|
||||||
|
{
|
||||||
|
class FpsDisplay : OsuComponent
|
||||||
|
{
|
||||||
|
SpriteText fpsText;
|
||||||
|
public override void Load()
|
||||||
|
{
|
||||||
|
base.Load();
|
||||||
|
|
||||||
|
Add(fpsText = new SpriteText());
|
||||||
|
|
||||||
|
fpsText.Text = "...";
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Update()
|
||||||
|
{
|
||||||
|
fpsText.Text = ((int)(1000 / Clock.ElapsedFrameTime)).ToString();
|
||||||
|
base.Update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -6,6 +6,7 @@ using osu.Game.GameModes.Menu;
|
|||||||
using OpenTK;
|
using OpenTK;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.OS;
|
using osu.Framework.OS;
|
||||||
|
using osu.Game.GameModes.Play;
|
||||||
|
|
||||||
namespace osu.Game
|
namespace osu.Game
|
||||||
{
|
{
|
||||||
|
17
osu.Game/Users/User.cs
Normal file
17
osu.Game/Users/User.cs
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace osu.Game.Users
|
||||||
|
{
|
||||||
|
public class User
|
||||||
|
{
|
||||||
|
public int Id;
|
||||||
|
public string Username;
|
||||||
|
}
|
||||||
|
}
|
@ -45,9 +45,42 @@
|
|||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Compile Include="Beatmaps\Beatmap.cs" />
|
||||||
|
<Compile Include="Beatmaps\BeatmapSet.cs" />
|
||||||
|
<Compile Include="Beatmaps\Metadata.cs" />
|
||||||
|
<Compile Include="Beatmaps\Objects\HitObject.cs" />
|
||||||
|
<Compile Include="Beatmaps\Objects\Catch\CatchBaseHit.cs" />
|
||||||
|
<Compile Include="Beatmaps\Objects\Catch\Droplet.cs" />
|
||||||
|
<Compile Include="Beatmaps\Objects\Catch\Fruit.cs" />
|
||||||
|
<Compile Include="Beatmaps\Objects\Mania\HoldNote.cs" />
|
||||||
|
<Compile Include="Beatmaps\Objects\Mania\ManiaBaseHit.cs" />
|
||||||
|
<Compile Include="Beatmaps\Objects\Mania\Note.cs" />
|
||||||
|
<Compile Include="Beatmaps\Objects\Osu\Circle.cs" />
|
||||||
|
<Compile Include="Beatmaps\Objects\Osu\OsuBaseHit.cs" />
|
||||||
|
<Compile Include="Beatmaps\Objects\Osu\Slider.cs" />
|
||||||
|
<Compile Include="Beatmaps\Objects\Osu\Spinner.cs" />
|
||||||
|
<Compile Include="Beatmaps\Objects\Taiko\TaikoBaseHit.cs" />
|
||||||
|
<Compile Include="Beatmaps\Samples\HitSampleInfo.cs" />
|
||||||
|
<Compile Include="Beatmaps\Samples\SampleBank.cs" />
|
||||||
|
<Compile Include="Beatmaps\Samples\SampleInfo.cs" />
|
||||||
|
<Compile Include="Beatmaps\Samples\SampleSet.cs" />
|
||||||
|
<Compile Include="Beatmaps\Samples\SampleType.cs" />
|
||||||
|
<Compile Include="Beatmaps\Timing\ControlPoint.cs" />
|
||||||
|
<Compile Include="Beatmaps\Timing\SampleChange.cs" />
|
||||||
|
<Compile Include="Beatmaps\Timing\TimingChange.cs" />
|
||||||
<Compile Include="Configuration\OsuConfigManager.cs" />
|
<Compile Include="Configuration\OsuConfigManager.cs" />
|
||||||
<Compile Include="GameModes\Menu\ButtonSystem.cs" />
|
<Compile Include="GameModes\Menu\ButtonSystem.cs" />
|
||||||
<Compile Include="GameModes\Menu\MainMenu.cs" />
|
<Compile Include="GameModes\Menu\MainMenu.cs" />
|
||||||
|
<Compile Include="GameModes\Play\Catch\CatchHitRenderer.cs" />
|
||||||
|
<Compile Include="GameModes\Play\Catch\CatchPlayfield.cs" />
|
||||||
|
<Compile Include="GameModes\Play\HitRenderer.cs" />
|
||||||
|
<Compile Include="GameModes\Play\Mania\ManiaHitRenderer.cs" />
|
||||||
|
<Compile Include="GameModes\Play\Mania\ManiaPlayfield.cs" />
|
||||||
|
<Compile Include="GameModes\Play\Osu\OsuHitRenderer.cs" />
|
||||||
|
<Compile Include="GameModes\Play\Osu\OsuPlayfield.cs" />
|
||||||
|
<Compile Include="GameModes\Play\Playfield.cs" />
|
||||||
|
<Compile Include="GameModes\Play\Taiko\TaikoHitRenderer.cs" />
|
||||||
|
<Compile Include="GameModes\Play\Taiko\TaikoPlayfield.cs" />
|
||||||
<Compile Include="Graphics\Containers\OsuComponent.cs" />
|
<Compile Include="Graphics\Containers\OsuComponent.cs" />
|
||||||
<Compile Include="Graphics\Containers\OsuGameMode.cs" />
|
<Compile Include="Graphics\Containers\OsuGameMode.cs" />
|
||||||
<Compile Include="Graphics\Containers\OsuLargeComponent.cs" />
|
<Compile Include="Graphics\Containers\OsuLargeComponent.cs" />
|
||||||
@ -70,6 +103,7 @@
|
|||||||
<Compile Include="OsuGame.cs" />
|
<Compile Include="OsuGame.cs" />
|
||||||
<Compile Include="OsuGameBase.cs" />
|
<Compile Include="OsuGameBase.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
<Compile Include="Users\User.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\osu-framework\osu.Framework\osu.Framework.csproj">
|
<ProjectReference Include="..\osu-framework\osu.Framework\osu.Framework.csproj">
|
||||||
|
Loading…
Reference in New Issue
Block a user