mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 00:42:55 +08:00
Rename "playableBeatmap" check arg to "beatmap"
The working beatmap is now in the context, so it's easier to distinguish beatmap type, hence no need for this prefix.
This commit is contained in:
parent
64d96b06a6
commit
b7bc42e0d3
@ -32,9 +32,9 @@ namespace osu.Game.Rulesets.Osu.Edit.Checks
|
|||||||
new IssueTemplateOffscreenSlider(this)
|
new IssueTemplateOffscreenSlider(this)
|
||||||
};
|
};
|
||||||
|
|
||||||
public IEnumerable<Issue> Run(IBeatmap playableBeatmap, BeatmapVerifierContext context)
|
public IEnumerable<Issue> Run(IBeatmap beatmap, BeatmapVerifierContext context)
|
||||||
{
|
{
|
||||||
foreach (var hitobject in playableBeatmap.HitObjects)
|
foreach (var hitobject in beatmap.HitObjects)
|
||||||
{
|
{
|
||||||
switch (hitobject)
|
switch (hitobject)
|
||||||
{
|
{
|
||||||
|
@ -17,9 +17,9 @@ namespace osu.Game.Rulesets.Osu.Edit
|
|||||||
new CheckOffscreenObjects()
|
new CheckOffscreenObjects()
|
||||||
};
|
};
|
||||||
|
|
||||||
public IEnumerable<Issue> Run(IBeatmap playableBeatmap, BeatmapVerifierContext context)
|
public IEnumerable<Issue> Run(IBeatmap beatmap, BeatmapVerifierContext context)
|
||||||
{
|
{
|
||||||
return checks.SelectMany(check => check.Run(playableBeatmap, context));
|
return checks.SelectMany(check => check.Run(beatmap, context));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,9 +29,9 @@ namespace osu.Game.Rulesets.Edit
|
|||||||
new CheckConcurrentObjects()
|
new CheckConcurrentObjects()
|
||||||
};
|
};
|
||||||
|
|
||||||
public IEnumerable<Issue> Run(IBeatmap playableBeatmap, BeatmapVerifierContext context)
|
public IEnumerable<Issue> Run(IBeatmap beatmap, BeatmapVerifierContext context)
|
||||||
{
|
{
|
||||||
return checks.SelectMany(check => check.Run(playableBeatmap, context));
|
return checks.SelectMany(check => check.Run(beatmap, context));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,6 @@ namespace osu.Game.Rulesets.Edit.Checks
|
|||||||
{
|
{
|
||||||
protected override CheckCategory Category => CheckCategory.Audio;
|
protected override CheckCategory Category => CheckCategory.Audio;
|
||||||
protected override string TypeOfFile => "audio";
|
protected override string TypeOfFile => "audio";
|
||||||
protected override string GetFilename(IBeatmap playableBeatmap) => playableBeatmap.Metadata?.AudioFile;
|
protected override string GetFilename(IBeatmap beatmap) => beatmap.Metadata?.AudioFile;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,9 +26,9 @@ namespace osu.Game.Rulesets.Edit.Checks
|
|||||||
new IssueTemplateNoBitrate(this)
|
new IssueTemplateNoBitrate(this)
|
||||||
};
|
};
|
||||||
|
|
||||||
public IEnumerable<Issue> Run(IBeatmap playableBeatmap, BeatmapVerifierContext context)
|
public IEnumerable<Issue> Run(IBeatmap beatmap, BeatmapVerifierContext context)
|
||||||
{
|
{
|
||||||
var audioFile = playableBeatmap.Metadata?.AudioFile;
|
var audioFile = beatmap.Metadata?.AudioFile;
|
||||||
if (audioFile == null)
|
if (audioFile == null)
|
||||||
yield break;
|
yield break;
|
||||||
|
|
||||||
|
@ -10,6 +10,6 @@ namespace osu.Game.Rulesets.Edit.Checks
|
|||||||
{
|
{
|
||||||
protected override CheckCategory Category => CheckCategory.Resources;
|
protected override CheckCategory Category => CheckCategory.Resources;
|
||||||
protected override string TypeOfFile => "background";
|
protected override string TypeOfFile => "background";
|
||||||
protected override string GetFilename(IBeatmap playableBeatmap) => playableBeatmap.Metadata?.BackgroundFile;
|
protected override string GetFilename(IBeatmap beatmap) => beatmap.Metadata?.BackgroundFile;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,9 +30,9 @@ namespace osu.Game.Rulesets.Edit.Checks
|
|||||||
new IssueTemplateTooUncompressed(this)
|
new IssueTemplateTooUncompressed(this)
|
||||||
};
|
};
|
||||||
|
|
||||||
public IEnumerable<Issue> Run(IBeatmap playableBeatmap, BeatmapVerifierContext context)
|
public IEnumerable<Issue> Run(IBeatmap beatmap, BeatmapVerifierContext context)
|
||||||
{
|
{
|
||||||
var backgroundFile = playableBeatmap.Metadata?.BackgroundFile;
|
var backgroundFile = beatmap.Metadata?.BackgroundFile;
|
||||||
if (backgroundFile == null)
|
if (backgroundFile == null)
|
||||||
yield break;
|
yield break;
|
||||||
|
|
||||||
@ -48,7 +48,7 @@ namespace osu.Game.Rulesets.Edit.Checks
|
|||||||
else if (texture.Width < low_width || texture.Height < low_height)
|
else if (texture.Width < low_width || texture.Height < low_height)
|
||||||
yield return new IssueTemplateLowResolution(this).Create(texture.Width, texture.Height);
|
yield return new IssueTemplateLowResolution(this).Create(texture.Width, texture.Height);
|
||||||
|
|
||||||
string storagePath = playableBeatmap.BeatmapInfo.BeatmapSet.GetPathForFile(backgroundFile);
|
string storagePath = beatmap.BeatmapInfo.BeatmapSet.GetPathForFile(backgroundFile);
|
||||||
double filesizeMb = context.WorkingBeatmap.GetStream(storagePath).Length / (1024d * 1024d);
|
double filesizeMb = context.WorkingBeatmap.GetStream(storagePath).Length / (1024d * 1024d);
|
||||||
|
|
||||||
if (filesizeMb > max_filesize_mb)
|
if (filesizeMb > max_filesize_mb)
|
||||||
|
@ -22,15 +22,15 @@ namespace osu.Game.Rulesets.Edit.Checks
|
|||||||
new IssueTemplateConcurrentDifferent(this)
|
new IssueTemplateConcurrentDifferent(this)
|
||||||
};
|
};
|
||||||
|
|
||||||
public IEnumerable<Issue> Run(IBeatmap playableBeatmap, BeatmapVerifierContext context)
|
public IEnumerable<Issue> Run(IBeatmap beatmap, BeatmapVerifierContext context)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < playableBeatmap.HitObjects.Count - 1; ++i)
|
for (int i = 0; i < beatmap.HitObjects.Count - 1; ++i)
|
||||||
{
|
{
|
||||||
var hitobject = playableBeatmap.HitObjects[i];
|
var hitobject = beatmap.HitObjects[i];
|
||||||
|
|
||||||
for (int j = i + 1; j < playableBeatmap.HitObjects.Count; ++j)
|
for (int j = i + 1; j < beatmap.HitObjects.Count; ++j)
|
||||||
{
|
{
|
||||||
var nextHitobject = playableBeatmap.HitObjects[j];
|
var nextHitobject = beatmap.HitObjects[j];
|
||||||
|
|
||||||
// Accounts for rulesets with hitobjects separated by columns, such as Mania.
|
// Accounts for rulesets with hitobjects separated by columns, such as Mania.
|
||||||
// In these cases we only care about concurrent objects within the same column.
|
// In these cases we only care about concurrent objects within the same column.
|
||||||
|
@ -11,7 +11,7 @@ namespace osu.Game.Rulesets.Edit.Checks
|
|||||||
{
|
{
|
||||||
protected abstract CheckCategory Category { get; }
|
protected abstract CheckCategory Category { get; }
|
||||||
protected abstract string TypeOfFile { get; }
|
protected abstract string TypeOfFile { get; }
|
||||||
protected abstract string GetFilename(IBeatmap playableBeatmap);
|
protected abstract string GetFilename(IBeatmap beatmap);
|
||||||
|
|
||||||
public CheckMetadata Metadata => new CheckMetadata(Category, $"Missing {TypeOfFile}");
|
public CheckMetadata Metadata => new CheckMetadata(Category, $"Missing {TypeOfFile}");
|
||||||
|
|
||||||
@ -21,9 +21,9 @@ namespace osu.Game.Rulesets.Edit.Checks
|
|||||||
new IssueTemplateDoesNotExist(this)
|
new IssueTemplateDoesNotExist(this)
|
||||||
};
|
};
|
||||||
|
|
||||||
public IEnumerable<Issue> Run(IBeatmap playableBeatmap, BeatmapVerifierContext context)
|
public IEnumerable<Issue> Run(IBeatmap beatmap, BeatmapVerifierContext context)
|
||||||
{
|
{
|
||||||
var filename = GetFilename(playableBeatmap);
|
var filename = GetFilename(beatmap);
|
||||||
|
|
||||||
if (filename == null)
|
if (filename == null)
|
||||||
{
|
{
|
||||||
@ -33,7 +33,7 @@ namespace osu.Game.Rulesets.Edit.Checks
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If the file is set, also make sure it still exists.
|
// If the file is set, also make sure it still exists.
|
||||||
var storagePath = playableBeatmap.BeatmapInfo.BeatmapSet.GetPathForFile(filename);
|
var storagePath = beatmap.BeatmapInfo.BeatmapSet.GetPathForFile(filename);
|
||||||
if (storagePath != null)
|
if (storagePath != null)
|
||||||
yield break;
|
yield break;
|
||||||
|
|
||||||
|
@ -22,11 +22,11 @@ namespace osu.Game.Rulesets.Edit.Checks
|
|||||||
new IssueTemplateSmallUnsnap(this)
|
new IssueTemplateSmallUnsnap(this)
|
||||||
};
|
};
|
||||||
|
|
||||||
public IEnumerable<Issue> Run(IBeatmap playableBeatmap, BeatmapVerifierContext context)
|
public IEnumerable<Issue> Run(IBeatmap beatmap, BeatmapVerifierContext context)
|
||||||
{
|
{
|
||||||
var controlPointInfo = playableBeatmap.ControlPointInfo;
|
var controlPointInfo = beatmap.ControlPointInfo;
|
||||||
|
|
||||||
foreach (var hitobject in playableBeatmap.HitObjects)
|
foreach (var hitobject in beatmap.HitObjects)
|
||||||
{
|
{
|
||||||
double startUnsnap = hitobject.StartTime - controlPointInfo.GetClosestSnappedTime(hitobject.StartTime);
|
double startUnsnap = hitobject.StartTime - controlPointInfo.GetClosestSnappedTime(hitobject.StartTime);
|
||||||
string startPostfix = hitobject is IHasDuration ? "start" : "";
|
string startPostfix = hitobject is IHasDuration ? "start" : "";
|
||||||
|
@ -24,8 +24,8 @@ namespace osu.Game.Rulesets.Edit.Checks.Components
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Runs this check and returns any issues detected for the provided beatmap.
|
/// Runs this check and returns any issues detected for the provided beatmap.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="playableBeatmap">The playable beatmap of the beatmap to run the check on.</param>
|
/// <param name="beatmap">The playable beatmap of the beatmap to run the check on.</param>
|
||||||
/// <param name="context">The beatmap verifier context associated with the beatmap.</param>
|
/// <param name="context">The beatmap verifier context associated with the beatmap.</param>
|
||||||
public IEnumerable<Issue> Run(IBeatmap playableBeatmap, BeatmapVerifierContext context);
|
public IEnumerable<Issue> Run(IBeatmap beatmap, BeatmapVerifierContext context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,6 @@ namespace osu.Game.Rulesets.Edit
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IBeatmapVerifier
|
public interface IBeatmapVerifier
|
||||||
{
|
{
|
||||||
public IEnumerable<Issue> Run(IBeatmap playableBeatmap, BeatmapVerifierContext context);
|
public IEnumerable<Issue> Run(IBeatmap beatmap, BeatmapVerifierContext context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user