1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-18 14:52:56 +08:00

Converted all files to use CRLF line endings.

This commit is contained in:
John Leuenhagen 2016-10-13 16:39:56 -04:00
parent b7976dce46
commit 4edd9b0cb3
No known key found for this signature in database
GPG Key ID: 907086AC94B52427
126 changed files with 1002 additions and 997 deletions

View File

@ -1,28 +1,28 @@
# osu! [![Build status](https://ci.appveyor.com/api/projects/status/u2p01nx7l6og8buh?svg=true)](https://ci.appveyor.com/project/peppy/osu)
[osu! on the web](https://osu.ppy.sh) | [dev chat](https://discord.gg/ppy)
Rhythm is just a *click* away. The future of osu! and the beginning of an open era!
# Requirements
- A desktop platform which can compile .NET 4.5.
- Visual Studio or MonoDevelop is recommended.
# Contributing
We welcome all contributions, but keep in mind that we already have a lot of the UI designed. If you wish to work on something with the intention on having it included in the official distribution, please open an issue for discussion and we will give you what you need from a design perspective to proceed. If you want to make *changes* to the design, we recommend you open an issue with your intentions before spending too much time, to ensure no effort is wasted.
Contributions can be made via pull requests to this repository. We hope to credit and reward larger contributions via a [bounty system](https://goo.gl/nFdoyI). If you're unsure of what you can help with, check out the [list](https://github.com/ppy/osu/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+label%3Abounty) of available issues with bounty.
Note that while we already have certain standards in place, nothing is set in stone. If you have an issue with the way code is structured; with any libraries we are using; with any processes involved with contributing, *please* bring it up. I welcome all feedback so we can make contributing to this project as pain-free as possible.
# Licence
The osu! client code and framework are licensed under the [MIT licence](https://opensource.org/licenses/MIT). Please see [the licence file](LICENCE) for more information. [tl;dr](https://tldrlegal.com/license/mit-license) you can do whatever you want as long as you include the original copyright and license notice in any copy of the software/source.
Please note that this *does not cover* the usage of the "osu!" or "ppy" branding in any software, resources, advertising or promotion, as this is protected by trademark law.
Please also note that game resources are covered by a separate licence. Please see the [ppy/osu-resources](https://github.com/ppy/osu-resources) repository for clarifications.
# osu! [![Build status](https://ci.appveyor.com/api/projects/status/u2p01nx7l6og8buh?svg=true)](https://ci.appveyor.com/project/peppy/osu)
[osu! on the web](https://osu.ppy.sh) | [dev chat](https://discord.gg/ppy)
Rhythm is just a *click* away. The future of osu! and the beginning of an open era!
# Requirements
- A desktop platform which can compile .NET 4.5.
- Visual Studio or MonoDevelop is recommended.
# Contributing
We welcome all contributions, but keep in mind that we already have a lot of the UI designed. If you wish to work on something with the intention on having it included in the official distribution, please open an issue for discussion and we will give you what you need from a design perspective to proceed. If you want to make *changes* to the design, we recommend you open an issue with your intentions before spending too much time, to ensure no effort is wasted.
Contributions can be made via pull requests to this repository. We hope to credit and reward larger contributions via a [bounty system](https://goo.gl/nFdoyI). If you're unsure of what you can help with, check out the [list](https://github.com/ppy/osu/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+label%3Abounty) of available issues with bounty.
Note that while we already have certain standards in place, nothing is set in stone. If you have an issue with the way code is structured; with any libraries we are using; with any processes involved with contributing, *please* bring it up. I welcome all feedback so we can make contributing to this project as pain-free as possible.
# Licence
The osu! client code and framework are licensed under the [MIT licence](https://opensource.org/licenses/MIT). Please see [the licence file](LICENCE) for more information. [tl;dr](https://tldrlegal.com/license/mit-license) you can do whatever you want as long as you include the original copyright and license notice in any copy of the software/source.
Please note that this *does not cover* the usage of the "osu!" or "ppy" branding in any software, resources, advertising or promotion, as this is protected by trademark law.
Please also note that game resources are covered by a separate licence. Please see the [ppy/osu-resources](https://github.com/ppy/osu-resources) repository for clarifications.

@ -1 +0,0 @@
Subproject commit 30ff0e1a99a10e735611bb3ffa35352061f52d8a

@ -1 +0,0 @@
Subproject commit 0505cf0d3b317667dbc95346f57b67fdbcdb4dee

View File

@ -1,4 +1,4 @@
// Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
// Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE
using System;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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.GameModes.Testing;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
// Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
// Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE
using osu.Framework.GameModes.Testing;

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<ProjectGuid>{69051C69-12AE-4E7D-A3E6-460D2E282312}</ProjectGuid>

View File

@ -1,38 +1,38 @@
using System;
using System.IO;
using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using osu.Game.Beatmaps.Formats;
using osu.Game.Beatmaps.IO;
using osu.Game.Beatmaps;
namespace osu.Desktop.Beatmaps.IO
{
/// <summary>
/// Reads an extracted legacy beatmap from disk.
/// </summary>
public class LegacyFilesystemReader : ArchiveReader
{
static LegacyFilesystemReader()
{
AddReader<LegacyFilesystemReader>((storage, path) => Directory.Exists(path));
}
private string basePath { get; set; }
private string[] beatmaps { get; set; }
private Beatmap firstMap { get; set; }
public LegacyFilesystemReader(string path)
{
basePath = path;
beatmaps = Directory.GetFiles(basePath, @"*.osu").Select(f => Path.GetFileName(f)).ToArray();
if (beatmaps.Length == 0)
throw new FileNotFoundException(@"This directory contains no beatmaps");
using (var stream = new StreamReader(ReadFile(beatmaps[0])))
{
var decoder = BeatmapDecoder.GetDecoder(stream);
firstMap = decoder.Decode(stream);
}
namespace osu.Desktop.Beatmaps.IO
{
/// <summary>
/// Reads an extracted legacy beatmap from disk.
/// </summary>
public class LegacyFilesystemReader : ArchiveReader
{
static LegacyFilesystemReader()
{
AddReader<LegacyFilesystemReader>((storage, path) => Directory.Exists(path));
}
private string basePath { get; set; }
private string[] beatmaps { get; set; }
private Beatmap firstMap { get; set; }
public LegacyFilesystemReader(string path)
{
basePath = path;
beatmaps = Directory.GetFiles(basePath, @"*.osu").Select(f => Path.GetFileName(f)).ToArray();
if (beatmaps.Length == 0)
throw new FileNotFoundException(@"This directory contains no beatmaps");
using (var stream = new StreamReader(ReadFile(beatmaps[0])))
{
var decoder = BeatmapDecoder.GetDecoder(stream);
firstMap = decoder.Decode(stream);
}
}
public override string[] ReadBeatmaps()
@ -48,10 +48,11 @@ namespace osu.Desktop.Beatmaps.IO
public override BeatmapMetadata ReadMetadata()
{
return firstMap.Metadata;
}
}
public override void Dispose()
{
{
// no-op
} }
}
}
}

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<ProjectGuid>{2A66DD92-ADB1-4994-89E2-C94E04ACDA0D}</ProjectGuid>

View File

@ -1,6 +1,6 @@
using System;
using System;
using System.IO;
using NUnit.Framework;
using NUnit.Framework;
using OpenTK;
using OpenTK.Graphics;
using osu.Game.Beatmaps.Formats;
@ -9,135 +9,137 @@ using osu.Game.Beatmaps.Samples;
using osu.Game.GameModes.Play;
using osu.Game.Tests.Resources;
namespace osu.Game.Tests.Beatmaps.Formats
{
[TestFixture]
public class OsuLegacyDecoderTest
{
[TestFixtureSetUp]
public void SetUp()
{
OsuLegacyDecoder.Register();
}
[Test]
public void TestDecodeMetadata()
{
var decoder = new OsuLegacyDecoder();
using (var stream = Resource.OpenResource("Soleily - Renatus (Gamu) [Insane].osu"))
{
var beatmap = decoder.Decode(new StreamReader(stream));
var meta = beatmap.Metadata;
Assert.AreEqual(241526, meta.BeatmapSetID);
Assert.AreEqual("Soleily", meta.Artist);
Assert.AreEqual("Soleily", meta.ArtistUnicode);
Assert.AreEqual("03. Renatus - Soleily 192kbps.mp3", meta.AudioFile);
Assert.AreEqual("Gamu", meta.Author);
Assert.AreEqual("machinetop_background.jpg", meta.BackgroundFile);
Assert.AreEqual(164471, meta.PreviewTime);
Assert.AreEqual(string.Empty, meta.Source);
Assert.AreEqual("MBC7 Unisphere 地球ヤバイEP Chikyu Yabai", meta.Tags);
Assert.AreEqual("Renatus", meta.Title);
Assert.AreEqual("Renatus", meta.TitleUnicode);
}
namespace osu.Game.Tests.Beatmaps.Formats
{
[TestFixture]
public class OsuLegacyDecoderTest
{
[TestFixtureSetUp]
public void SetUp()
{
OsuLegacyDecoder.Register();
}
[Test]
public void TestDecodeGeneral()
{
var decoder = new OsuLegacyDecoder();
using (var stream = Resource.OpenResource("Soleily - Renatus (Gamu) [Insane].osu"))
{
var beatmap = decoder.Decode(new StreamReader(stream));
Assert.AreEqual(0, beatmap.AudioLeadIn);
Assert.AreEqual(false, beatmap.Countdown);
Assert.AreEqual(SampleSet.Soft, beatmap.SampleSet);
Assert.AreEqual(0.7f, beatmap.StackLeniency);
Assert.AreEqual(false, beatmap.SpecialStyle);
Assert.AreEqual(PlayMode.Osu, beatmap.Mode);
Assert.AreEqual(false, beatmap.LetterboxInBreaks);
Assert.AreEqual(false, beatmap.WidescreenStoryboard);
}
[Test]
public void TestDecodeMetadata()
{
var decoder = new OsuLegacyDecoder();
using (var stream = Resource.OpenResource("Soleily - Renatus (Gamu) [Insane].osu"))
{
var beatmap = decoder.Decode(new StreamReader(stream));
var meta = beatmap.Metadata;
Assert.AreEqual(241526, meta.BeatmapSetID);
Assert.AreEqual("Soleily", meta.Artist);
Assert.AreEqual("Soleily", meta.ArtistUnicode);
Assert.AreEqual("03. Renatus - Soleily 192kbps.mp3", meta.AudioFile);
Assert.AreEqual("Gamu", meta.Author);
Assert.AreEqual("machinetop_background.jpg", meta.BackgroundFile);
Assert.AreEqual(164471, meta.PreviewTime);
Assert.AreEqual(string.Empty, meta.Source);
Assert.AreEqual("MBC7 Unisphere 地球ヤバイEP Chikyu Yabai", meta.Tags);
Assert.AreEqual("Renatus", meta.Title);
Assert.AreEqual("Renatus", meta.TitleUnicode);
}
}
[Test]
public void TestDecodeEditor()
{
var decoder = new OsuLegacyDecoder();
using (var stream = Resource.OpenResource("Soleily - Renatus (Gamu) [Insane].osu"))
{
var beatmap = decoder.Decode(new StreamReader(stream));
int[] expectedBookmarks =
{
11505, 22054, 32604, 43153, 53703, 64252, 74802, 85351,
95901, 106450, 116999, 119637, 130186, 140735, 151285,
161834, 164471, 175020, 185570, 196119, 206669, 209306
};
Assert.AreEqual(expectedBookmarks.Length, beatmap.Bookmarks.Length);
for (int i = 0; i < expectedBookmarks.Length; i++)
Assert.AreEqual(expectedBookmarks[i], beatmap.Bookmarks[i]);
Assert.AreEqual(1.8, beatmap.DistanceSpacing);
Assert.AreEqual(4, beatmap.BeatDivisor);
Assert.AreEqual(4, beatmap.GridSize);
Assert.AreEqual(2, beatmap.TimelineZoom);
}
[Test]
public void TestDecodeGeneral()
{
var decoder = new OsuLegacyDecoder();
using (var stream = Resource.OpenResource("Soleily - Renatus (Gamu) [Insane].osu"))
{
var beatmap = decoder.Decode(new StreamReader(stream));
Assert.AreEqual(0, beatmap.AudioLeadIn);
Assert.AreEqual(false, beatmap.Countdown);
Assert.AreEqual(SampleSet.Soft, beatmap.SampleSet);
Assert.AreEqual(0.7f, beatmap.StackLeniency);
Assert.AreEqual(false, beatmap.SpecialStyle);
Assert.AreEqual(PlayMode.Osu, beatmap.Mode);
Assert.AreEqual(false, beatmap.LetterboxInBreaks);
Assert.AreEqual(false, beatmap.WidescreenStoryboard);
}
}
[Test]
public void TestDecodeDifficulty()
{
var decoder = new OsuLegacyDecoder();
using (var stream = Resource.OpenResource("Soleily - Renatus (Gamu) [Insane].osu"))
{
var beatmap = decoder.Decode(new StreamReader(stream));
var difficulty = beatmap.BaseDifficulty;
Assert.AreEqual(6.5f, difficulty.DrainRate);
Assert.AreEqual(4, difficulty.CircleSize);
Assert.AreEqual(8, difficulty.OverallDifficulty);
Assert.AreEqual(9, difficulty.ApproachRate);
Assert.AreEqual(1.8f, difficulty.SliderMultiplier);
Assert.AreEqual(2, difficulty.SliderTickRate);
}
[Test]
public void TestDecodeEditor()
{
var decoder = new OsuLegacyDecoder();
using (var stream = Resource.OpenResource("Soleily - Renatus (Gamu) [Insane].osu"))
{
var beatmap = decoder.Decode(new StreamReader(stream));
int[] expectedBookmarks =
{
11505, 22054, 32604, 43153, 53703, 64252, 74802, 85351,
95901, 106450, 116999, 119637, 130186, 140735, 151285,
161834, 164471, 175020, 185570, 196119, 206669, 209306
};
Assert.AreEqual(expectedBookmarks.Length, beatmap.Bookmarks.Length);
for (int i = 0; i < expectedBookmarks.Length; i++)
Assert.AreEqual(expectedBookmarks[i], beatmap.Bookmarks[i]);
Assert.AreEqual(1.8, beatmap.DistanceSpacing);
Assert.AreEqual(4, beatmap.BeatDivisor);
Assert.AreEqual(4, beatmap.GridSize);
Assert.AreEqual(2, beatmap.TimelineZoom);
}
}
[Test]
public void TestDecodeColors()
{
var decoder = new OsuLegacyDecoder();
using (var stream = Resource.OpenResource("Soleily - Renatus (Gamu) [Insane].osu"))
{
var beatmap = decoder.Decode(new StreamReader(stream));
[Test]
public void TestDecodeDifficulty()
{
var decoder = new OsuLegacyDecoder();
using (var stream = Resource.OpenResource("Soleily - Renatus (Gamu) [Insane].osu"))
{
var beatmap = decoder.Decode(new StreamReader(stream));
var difficulty = beatmap.BaseDifficulty;
Assert.AreEqual(6.5f, difficulty.DrainRate);
Assert.AreEqual(4, difficulty.CircleSize);
Assert.AreEqual(8, difficulty.OverallDifficulty);
Assert.AreEqual(9, difficulty.ApproachRate);
Assert.AreEqual(1.8f, difficulty.SliderMultiplier);
Assert.AreEqual(2, difficulty.SliderTickRate);
}
}
[Test]
public void TestDecodeColors()
{
var decoder = new OsuLegacyDecoder();
using (var stream = Resource.OpenResource("Soleily - Renatus (Gamu) [Insane].osu"))
{
var beatmap = decoder.Decode(new StreamReader(stream));
Color4[] expected =
{
new Color4(142, 199, 255, 255),
new Color4(255, 128, 128, 255),
new Color4(128, 255, 255, 255),
new Color4(128, 255, 128, 255),
new Color4(255, 187, 255, 255),
new Color4(255, 177, 140, 255),
};
Assert.AreEqual(expected.Length, beatmap.ComboColors.Count);
for (int i = 0; i < expected.Length; i++)
Assert.AreEqual(expected[i], beatmap.ComboColors[i]);
}
{
new Color4(142, 199, 255, 255),
new Color4(255, 128, 128, 255),
new Color4(128, 255, 255, 255),
new Color4(128, 255, 128, 255),
new Color4(255, 187, 255, 255),
new Color4(255, 177, 140, 255),
};
Assert.AreEqual(expected.Length, beatmap.ComboColors.Count);
for (int i = 0; i < expected.Length; i++)
Assert.AreEqual(expected[i], beatmap.ComboColors[i]);
}
}
[Test] public void TestDecodeHitObjects()
{
var decoder = new OsuLegacyDecoder();
using (var stream = Resource.OpenResource("Soleily - Renatus (Gamu) [Insane].osu"))
{
var beatmap = decoder.Decode(new StreamReader(stream));
var slider = beatmap.HitObjects[0] as Slider;
Assert.IsNotNull(slider);
Assert.AreEqual(new Vector2(192, 168), slider.Position);
Assert.AreEqual(956, slider.StartTime);
Assert.AreEqual(SampleType.None, slider.Sample.Type);
var circle = beatmap.HitObjects[1] as Circle;
Assert.IsNotNull(circle);
Assert.AreEqual(new Vector2(304, 56), circle.Position);
Assert.AreEqual(1285, circle.StartTime);
[Test]
public void TestDecodeHitObjects()
{
var decoder = new OsuLegacyDecoder();
using (var stream = Resource.OpenResource("Soleily - Renatus (Gamu) [Insane].osu"))
{
var beatmap = decoder.Decode(new StreamReader(stream));
var slider = beatmap.HitObjects[0] as Slider;
Assert.IsNotNull(slider);
Assert.AreEqual(new Vector2(192, 168), slider.Position);
Assert.AreEqual(956, slider.StartTime);
Assert.AreEqual(SampleType.None, slider.Sample.Type);
var circle = beatmap.HitObjects[1] as Circle;
Assert.IsNotNull(circle);
Assert.AreEqual(new Vector2(304, 56), circle.Position);
Assert.AreEqual(1285, circle.StartTime);
Assert.AreEqual(SampleType.Clap, circle.Sample.Type);
}
}
}
}
}
}
}

View File

@ -1,81 +1,82 @@
using System;
using System;
using System.IO;
using NUnit.Framework;
using osu.Game.Beatmaps.IO;
using osu.Game.GameModes.Play;
using osu.Game.Tests.Resources;
namespace osu.Game.Tests.Beatmaps.IO
{
[TestFixture]
public class OszArchiveReaderTest
{
[TestFixtureSetUp]
public void SetUp()
{
OszArchiveReader.Register();
}
[Test]
public void TestReadBeatmaps()
{
using (var osz = Resource.OpenResource("Beatmaps.241526 Soleily - Renatus.osz"))
{
var reader = new OszArchiveReader(osz);
string[] expected =
{
"Soleily - Renatus (Deif) [Platter].osu",
"Soleily - Renatus (Deif) [Rain].osu",
"Soleily - Renatus (Deif) [Salad].osu",
"Soleily - Renatus (ExPew) [Another].osu",
"Soleily - Renatus (ExPew) [Hyper].osu",
"Soleily - Renatus (ExPew) [Normal].osu",
"Soleily - Renatus (Gamu) [Hard].osu",
"Soleily - Renatus (Gamu) [Insane].osu",
"Soleily - Renatus (Gamu) [Normal].osu",
"Soleily - Renatus (MMzz) [Futsuu].osu",
"Soleily - Renatus (MMzz) [Muzukashii].osu",
"Soleily - Renatus (MMzz) [Oni].osu"
};
var maps = reader.ReadBeatmaps();
foreach (var map in expected)
Assert.Contains(map, maps);
}
namespace osu.Game.Tests.Beatmaps.IO
{
[TestFixture]
public class OszArchiveReaderTest
{
[TestFixtureSetUp]
public void SetUp()
{
OszArchiveReader.Register();
}
[Test]
public void TestReadBeatmaps()
{
using (var osz = Resource.OpenResource("Beatmaps.241526 Soleily - Renatus.osz"))
{
var reader = new OszArchiveReader(osz);
string[] expected =
{
"Soleily - Renatus (Deif) [Platter].osu",
"Soleily - Renatus (Deif) [Rain].osu",
"Soleily - Renatus (Deif) [Salad].osu",
"Soleily - Renatus (ExPew) [Another].osu",
"Soleily - Renatus (ExPew) [Hyper].osu",
"Soleily - Renatus (ExPew) [Normal].osu",
"Soleily - Renatus (Gamu) [Hard].osu",
"Soleily - Renatus (Gamu) [Insane].osu",
"Soleily - Renatus (Gamu) [Normal].osu",
"Soleily - Renatus (MMzz) [Futsuu].osu",
"Soleily - Renatus (MMzz) [Muzukashii].osu",
"Soleily - Renatus (MMzz) [Oni].osu"
};
var maps = reader.ReadBeatmaps();
foreach (var map in expected)
Assert.Contains(map, maps);
}
}
[Test]
public void TestReadMetadata()
{
using (var osz = Resource.OpenResource("Beatmaps.241526 Soleily - Renatus.osz"))
{
var reader = new OszArchiveReader(osz);
var meta = reader.ReadMetadata();
Assert.AreEqual(241526, meta.BeatmapSetID);
Assert.AreEqual("Soleily", meta.Artist);
Assert.AreEqual("Soleily", meta.ArtistUnicode);
Assert.AreEqual("03. Renatus - Soleily 192kbps.mp3", meta.AudioFile);
Assert.AreEqual("Deif", meta.Author);
Assert.AreEqual("machinetop_background.jpg", meta.BackgroundFile);
Assert.AreEqual(164471, meta.PreviewTime);
Assert.AreEqual(string.Empty, meta.Source);
Assert.AreEqual("MBC7 Unisphere 地球ヤバイEP Chikyu Yabai", meta.Tags);
Assert.AreEqual("Renatus", meta.Title);
Assert.AreEqual("Renatus", meta.TitleUnicode);
}
[Test]
public void TestReadMetadata()
{
using (var osz = Resource.OpenResource("Beatmaps.241526 Soleily - Renatus.osz"))
{
var reader = new OszArchiveReader(osz);
var meta = reader.ReadMetadata();
Assert.AreEqual(241526, meta.BeatmapSetID);
Assert.AreEqual("Soleily", meta.Artist);
Assert.AreEqual("Soleily", meta.ArtistUnicode);
Assert.AreEqual("03. Renatus - Soleily 192kbps.mp3", meta.AudioFile);
Assert.AreEqual("Deif", meta.Author);
Assert.AreEqual("machinetop_background.jpg", meta.BackgroundFile);
Assert.AreEqual(164471, meta.PreviewTime);
Assert.AreEqual(string.Empty, meta.Source);
Assert.AreEqual("MBC7 Unisphere 地球ヤバイEP Chikyu Yabai", meta.Tags);
Assert.AreEqual("Renatus", meta.Title);
Assert.AreEqual("Renatus", meta.TitleUnicode);
}
}
[Test]
public void TestReadFile()
{
using (var osz = Resource.OpenResource("Beatmaps.241526 Soleily - Renatus.osz"))
{
var reader = new OszArchiveReader(osz);
using (var stream = new StreamReader(
reader.ReadFile("Soleily - Renatus (Deif) [Platter].osu")))
{
Assert.AreEqual("osu file format v13", stream.ReadLine().Trim());
}
}
}
}
}
[Test]
public void TestReadFile()
{
using (var osz = Resource.OpenResource("Beatmaps.241526 Soleily - Renatus.osz"))
{
var reader = new OszArchiveReader(osz);
using (var stream = new StreamReader(
reader.ReadFile("Soleily - Renatus (Deif) [Platter].osu")))
{
Assert.AreEqual("osu file format v13", stream.ReadLine().Trim());
}
}
}
}
}

View File

@ -1,17 +1,17 @@
using System;
using System;
using System.IO;
using System.Reflection;
namespace osu.Game.Tests.Resources
{
public static class Resource
{
public static Stream OpenResource(string name)
{
return Assembly.GetExecutingAssembly().GetManifestResourceStream(
$@"osu.Game.Tests.Resources.{name}") ??
Assembly.LoadFrom("osu.Game.Resources.dll").GetManifestResourceStream(
$@"osu.Game.Resources.{name}");
}
}
namespace osu.Game.Tests.Resources
{
public static class Resource
{
public static Stream OpenResource(string name)
{
return Assembly.GetExecutingAssembly().GetManifestResourceStream(
$@"osu.Game.Tests.Resources.{name}") ??
Assembly.LoadFrom("osu.Game.Resources.dll").GetManifestResourceStream(
$@"osu.Game.Resources.{name}");
}
}
}

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NUnit" version="2.6.4" targetFramework="net45" />
<package id="ppy.OpenTK" version="1.1.2225.3" targetFramework="net45" />
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NUnit" version="2.6.4" targetFramework="net45" />
<package id="ppy.OpenTK" version="1.1.2225.3" targetFramework="net45" />
</packages>

View File

@ -1,18 +1,18 @@
using System;
using System;
using SQLite;
namespace osu.Game.Beatmaps
{
public class BaseDifficulty
{
[PrimaryKey, AutoIncrement]
public int ID { get; set; }
public float DrainRate { get; set; }
public float CircleSize { get; set; }
public float OverallDifficulty { get; set; }
public float ApproachRate { get; set; }
public float SliderMultiplier { get; set; }
public float SliderTickRate { get; set; }
}
}
namespace osu.Game.Beatmaps
{
public class BaseDifficulty
{
[PrimaryKey, AutoIncrement]
public int ID { get; set; }
public float DrainRate { get; set; }
public float CircleSize { get; set; }
public float OverallDifficulty { get; set; }
public float ApproachRate { get; set; }
public float SliderMultiplier { get; set; }
public float SliderTickRate { get; set; }
}
}

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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.GameModes.Play;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,14 +1,14 @@
using System;
namespace osu.Game.Beatmaps.Events
{
public enum EventType
{
Background = 0,
Video = 1,
Break = 2,
Colour = 3,
Sprite = 4,
Sample = 5,
Animation = 6
}
using System;
namespace osu.Game.Beatmaps.Events
{
public enum EventType
{
Background = 0,
Video = 1,
Break = 2,
Colour = 3,
Sprite = 4,
Sample = 5,
Animation = 6
}
}

View File

@ -1,25 +1,26 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
namespace osu.Game.Beatmaps.Formats
{
public abstract class BeatmapDecoder
{
private static Dictionary<string, Type> decoders { get; } = new Dictionary<string, Type>();
public static BeatmapDecoder GetDecoder(TextReader stream)
{
var line = stream.ReadLine().Trim();
if (!decoders.ContainsKey(line))
throw new IOException(@"Unknown file format");
return (BeatmapDecoder)Activator.CreateInstance(decoders[line]);
using System.IO;
namespace osu.Game.Beatmaps.Formats
{
public abstract class BeatmapDecoder
{
private static Dictionary<string, Type> decoders { get; } = new Dictionary<string, Type>();
public static BeatmapDecoder GetDecoder(TextReader stream)
{
var line = stream.ReadLine().Trim();
if (!decoders.ContainsKey(line))
throw new IOException(@"Unknown file format");
return (BeatmapDecoder)Activator.CreateInstance(decoders[line]);
}
protected static void AddDecoder<T>(string magic) where T : BeatmapDecoder
{
decoders[magic] = typeof(T);
}
public abstract Beatmap Decode(TextReader stream);
}
protected static void AddDecoder<T>(string magic) where T : BeatmapDecoder
{
decoders[magic] = typeof(T);
}
public abstract Beatmap Decode(TextReader stream);
}
}

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;

View File

@ -1,48 +1,48 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using osu.Framework.Platform;
namespace osu.Game.Beatmaps.IO
{
public abstract class ArchiveReader : IDisposable
{
private class Reader
{
public Func<BasicStorage, string, bool> Test { get; set; }
public Type Type { get; set; }
}
private static List<Reader> readers { get; } = new List<Reader>();
public static ArchiveReader GetReader(BasicStorage storage, string path)
{
foreach (var reader in readers)
{
if (reader.Test(storage, path))
return (ArchiveReader)Activator.CreateInstance(reader.Type, storage.GetStream(path));
}
throw new IOException(@"Unknown file format");
}
protected static void AddReader<T>(Func<BasicStorage, string, bool> test) where T : ArchiveReader
{
readers.Add(new Reader { Test = test, Type = typeof(T) });
}
/// <summary>
/// Reads the beatmap metadata from this archive.
/// </summary>
public abstract BeatmapMetadata ReadMetadata();
/// <summary>
/// Gets a list of beatmap file names.
/// </summary>
public abstract string[] ReadBeatmaps();
/// <summary>
/// Opens a stream for reading a specific file from this archive.
/// </summary>
namespace osu.Game.Beatmaps.IO
{
public abstract class ArchiveReader : IDisposable
{
private class Reader
{
public Func<BasicStorage, string, bool> Test { get; set; }
public Type Type { get; set; }
}
private static List<Reader> readers { get; } = new List<Reader>();
public static ArchiveReader GetReader(BasicStorage storage, string path)
{
foreach (var reader in readers)
{
if (reader.Test(storage, path))
return (ArchiveReader)Activator.CreateInstance(reader.Type, storage.GetStream(path));
}
throw new IOException(@"Unknown file format");
}
protected static void AddReader<T>(Func<BasicStorage, string, bool> test) where T : ArchiveReader
{
readers.Add(new Reader { Test = test, Type = typeof(T) });
}
/// <summary>
/// Reads the beatmap metadata from this archive.
/// </summary>
public abstract BeatmapMetadata ReadMetadata();
/// <summary>
/// Gets a list of beatmap file names.
/// </summary>
public abstract string[] ReadBeatmaps();
/// <summary>
/// Opens a stream for reading a specific file from this archive.
/// </summary>
public abstract Stream ReadFile(string name);
public abstract void Dispose();
}
public abstract void Dispose();
}
}

View File

@ -1,39 +1,39 @@
using System;
using System;
using System.IO;
using System.Linq;
using Ionic.Zip;
using osu.Game.Beatmaps.Formats;
namespace osu.Game.Beatmaps.IO
{
public sealed class OszArchiveReader : ArchiveReader
{
public static void Register()
{
namespace osu.Game.Beatmaps.IO
{
public sealed class OszArchiveReader : ArchiveReader
{
public static void Register()
{
AddReader<OszArchiveReader>((storage, path) =>
{
using (var stream = storage.GetStream(path))
{
using (var stream = storage.GetStream(path))
return ZipFile.IsZipFile(stream, false);
});
OsuLegacyDecoder.Register();
}
private ZipFile archive { get; set; }
private string[] beatmaps { get; set; }
private Beatmap firstMap { get; set; }
public OszArchiveReader(Stream archiveStream)
{
archive = ZipFile.Read(archiveStream);
beatmaps = archive.Entries.Where(e => e.FileName.EndsWith(@".osu"))
.Select(e => e.FileName).ToArray();
if (beatmaps.Length == 0)
throw new FileNotFoundException(@"This directory contains no beatmaps");
using (var stream = new StreamReader(ReadFile(beatmaps[0])))
{
var decoder = BeatmapDecoder.GetDecoder(stream);
firstMap = decoder.Decode(stream);
}
});
OsuLegacyDecoder.Register();
}
private ZipFile archive { get; set; }
private string[] beatmaps { get; set; }
private Beatmap firstMap { get; set; }
public OszArchiveReader(Stream archiveStream)
{
archive = ZipFile.Read(archiveStream);
beatmaps = archive.Entries.Where(e => e.FileName.EndsWith(@".osu"))
.Select(e => e.FileName).ToArray();
if (beatmaps.Length == 0)
throw new FileNotFoundException(@"This directory contains no beatmaps");
using (var stream = new StreamReader(ReadFile(beatmaps[0])))
{
var decoder = BeatmapDecoder.GetDecoder(stream);
firstMap = decoder.Decode(stream);
}
}
public override string[] ReadBeatmaps()
@ -43,9 +43,9 @@ namespace osu.Game.Beatmaps.IO
public override Stream ReadFile(string name)
{
ZipEntry entry = archive.Entries.SingleOrDefault(e => e.FileName == name);
if (entry == null)
throw new FileNotFoundException();
ZipEntry entry = archive.Entries.SingleOrDefault(e => e.FileName == name);
if (entry == null)
throw new FileNotFoundException();
return entry.OpenReader();
}
@ -53,9 +53,10 @@ namespace osu.Game.Beatmaps.IO
{
return firstMap.Metadata;
}
public override void Dispose()
{
archive.Dispose();
public override void Dispose()
{
archive.Dispose();
}
}
}
}

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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.Objects.Osu;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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.Configuration;

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using osu.Framework.Platform;
@ -7,44 +7,45 @@ using osu.Game.Beatmaps.Formats;
using osu.Game.Beatmaps.IO;
using SQLite;
namespace osu.Game.Database
{
public class BeatmapDatabase
{
private static SQLiteConnection connection { get; set; }
public BeatmapDatabase(BasicStorage storage)
{
if (connection == null)
{
connection = storage.GetDatabase(@"beatmaps");
connection.CreateTable<BeatmapMetadata>();
connection.CreateTable<BaseDifficulty>();
connection.CreateTable<BeatmapSet>();
connection.CreateTable<Beatmap>();
}
namespace osu.Game.Database
{
public class BeatmapDatabase
{
private static SQLiteConnection connection { get; set; }
public BeatmapDatabase(BasicStorage storage)
{
if (connection == null)
{
connection = storage.GetDatabase(@"beatmaps");
connection.CreateTable<BeatmapMetadata>();
connection.CreateTable<BaseDifficulty>();
connection.CreateTable<BeatmapSet>();
connection.CreateTable<Beatmap>();
}
}
public void AddBeatmap(ArchiveReader input)
{
var metadata = input.ReadMetadata();
public void AddBeatmap(ArchiveReader input)
{
var metadata = input.ReadMetadata();
if (connection.Table<BeatmapSet>().Count(b => b.BeatmapSetID == metadata.BeatmapSetID) != 0)
return;
string[] mapNames = input.ReadBeatmaps();
var beatmapSet = new BeatmapSet { BeatmapSetID = metadata.BeatmapSetID };
var maps = new List<Beatmap>();
foreach (var name in mapNames)
{
using (var stream = new StreamReader(input.ReadFile(name)))
return;
string[] mapNames = input.ReadBeatmaps();
var beatmapSet = new BeatmapSet { BeatmapSetID = metadata.BeatmapSetID };
var maps = new List<Beatmap>();
foreach (var name in mapNames)
{
using (var stream = new StreamReader(input.ReadFile(name)))
{
var decoder = BeatmapDecoder.GetDecoder(stream);
var beatmap = decoder.Decode(stream);
maps.Add(beatmap);
beatmap.BaseDifficultyID = connection.Insert(beatmap.BaseDifficulty);
}
}
beatmapSet.BeatmapMetadataID = connection.Insert(metadata);
connection.Insert(beatmapSet);
connection.InsertAll(maps);
}
}
var decoder = BeatmapDecoder.GetDecoder(stream);
var beatmap = decoder.Decode(stream);
maps.Add(beatmap);
beatmap.BaseDifficultyID = connection.Insert(beatmap.BaseDifficulty);
}
}
beatmapSet.BeatmapMetadataID = connection.Insert(metadata);
connection.Insert(beatmapSet);
connection.InsertAll(maps);
}
}
}

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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.GameModes.Backgrounds

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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.GameModes.Direct

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
using OpenTK;
using OpenTK;
using OpenTK.Graphics;
using OpenTK.Input;
using osu.Framework;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
using OpenTK;
using OpenTK;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
using osu.Framework.Graphics;
using osu.Framework.Graphics;
using System;
using System.Collections.Generic;
using System.Linq;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics;
using osu.Framework.Input;
using OpenTK;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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.Input;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

View File

@ -1,4 +1,4 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//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;

Some files were not shown because too many files have changed in this diff Show More