1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 08:32:57 +08:00

Add basic class structure for Beatmap/HitObject/SampleInfo/User.

This commit is contained in:
Dean Herbert 2016-08-31 12:33:01 +09:00
parent 7e3d2ebe80
commit 3098204dda
9 changed files with 144 additions and 0 deletions

View 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.Collections.Generic;
using osu.Game.Beatmaps.Objects;
using osu.Game.Users;
namespace osu.Game.Beatmaps
{
public class Beatmap
{
public List<HitObject> HitObjects;
public string Difficulty;
public User Creator;
}
}

View File

@ -0,0 +1,21 @@
//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 string Artist;
public string Title;
public User Creator;
}
}

View 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 osu.Game.Beatmaps.Samples;
namespace osu.Game.Beatmaps.Objects
{
/// <summary>
/// A hitobject describes a point in a beatmap
/// </summary>
public class HitObject
{
public double StartTime;
public double? EndTime;
public SampleInfo Sample;
}
}

View 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
}
}

View 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;
}
}

View 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
}
}

View 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();
}
}
}

17
osu.Game/Users/User.cs Normal file
View 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;
}
}

View File

@ -45,6 +45,12 @@
<Reference Include="System.Core" />
</ItemGroup>
<ItemGroup>
<Compile Include="Beatmaps\Beatmap.cs" />
<Compile Include="Beatmaps\BeatmapSet.cs" />
<Compile Include="Beatmaps\Objects\HitObject.cs" />
<Compile Include="Beatmaps\Samples\SampleBank.cs" />
<Compile Include="Beatmaps\Samples\SampleInfo.cs" />
<Compile Include="Beatmaps\Samples\SampleSet.cs" />
<Compile Include="Configuration\OsuConfigManager.cs" />
<Compile Include="GameModes\FontTest.cs" />
<Compile Include="GameModes\Menu\ButtonSystem.cs" />
@ -68,6 +74,7 @@
<Compile Include="Online\Chat\Message.cs" />
<Compile Include="OsuGame.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Users\User.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\osu-framework\osu.Framework\osu.Framework.csproj">