Naming standardisation and enforcing.

This commit is contained in:
Dean Herbert
2017-02-07 16:15:45 +09:00
parent 50bd80cb0c
commit 6b011a50d2
28 changed files with 182 additions and 136 deletions

View File

@ -179,14 +179,14 @@ namespace osu.Game.Beatmaps.Formats
return; // TODO
string[] split = val.Split(',');
EventType type;
int _type;
if (!int.TryParse(split[0], out _type))
int intType;
if (!int.TryParse(split[0], out intType))
{
if (!Enum.TryParse(split[0], out type))
throw new InvalidDataException($@"Unknown event type {split[0]}");
}
else
type = (EventType)_type;
type = (EventType)intType;
// TODO: Parse and store the rest of the event
if (type == EventType.Background)
beatmap.BeatmapInfo.Metadata.BackgroundFile = split[2].Trim('"');
@ -200,7 +200,7 @@ namespace osu.Game.Beatmaps.Formats
if (split.Length > 2)
{
int kiai_flags = split.Length > 7 ? Convert.ToInt32(split[7], NumberFormatInfo.InvariantInfo) : 0;
int kiaiFlags = split.Length > 7 ? Convert.ToInt32(split[7], NumberFormatInfo.InvariantInfo) : 0;
double beatLength = double.Parse(split[1].Trim(), NumberFormatInfo.InvariantInfo);
cp = new ControlPoint
{

View File

@ -18,7 +18,7 @@ namespace osu.Game.Beatmaps
public readonly BeatmapSetInfo BeatmapSetInfo;
private readonly BeatmapDatabase database;
private ArchiveReader GetReader() => database?.GetReader(BeatmapSetInfo);
private ArchiveReader getReader() => database?.GetReader(BeatmapSetInfo);
private Texture background;
private object backgroundLock = new object();
@ -34,7 +34,7 @@ namespace osu.Game.Beatmaps
try
{
using (var reader = GetReader())
using (var reader = getReader())
background = new TextureStore(new RawTextureLoaderStore(reader), false).Get(BeatmapInfo.Metadata.BackgroundFile);
}
catch { }
@ -57,7 +57,7 @@ namespace osu.Game.Beatmaps
try
{
using (var reader = GetReader())
using (var reader = getReader())
using (var stream = new StreamReader(reader.GetStream(BeatmapInfo.Path)))
beatmap = BeatmapDecoder.GetDecoder(stream)?.Decode(stream);
}
@ -83,7 +83,7 @@ namespace osu.Game.Beatmaps
try
{
//store a reference to the reader as we may continue accessing the stream in the background.
trackReader = GetReader();
trackReader = getReader();
var trackData = trackReader?.GetStream(BeatmapInfo.Metadata.AudioFile);
if (trackData != null)
track = new AudioTrackBass(trackData);