Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix possibility of test rulesets being discovered from assemblies #2544

Merged
merged 3 commits into from
May 14, 2018
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions osu.Game.Rulesets.Catch.Tests/CatchBeatmapConversionTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

namespace osu.Game.Rulesets.Catch.Tests
{
public class CatchBeatmapConversionTest : BeatmapConversionTest<TestCatchRuleset, ConvertValue>
internal class CatchBeatmapConversionTest : BeatmapConversionTest<TestCatchRuleset, ConvertValue>
{
protected override string ResourceAssembly => "osu.Game.Rulesets.Catch";

Expand Down Expand Up @@ -50,7 +50,7 @@ protected override IEnumerable<ConvertValue> CreateConvertValue(HitObject hitObj
protected override IBeatmapConverter CreateConverter(IBeatmap beatmap) => new CatchBeatmapConverter(beatmap);
}

public struct ConvertValue : IEquatable<ConvertValue>
internal struct ConvertValue : IEquatable<ConvertValue>
{
/// <summary>
/// A sane value to account for osu!stable using ints everwhere.
Expand All @@ -65,7 +65,7 @@ public bool Equals(ConvertValue other)
&& Precision.AlmostEquals(Position, other.Position, conversion_lenience);
}

public class TestCatchRuleset : CatchRuleset
internal class TestCatchRuleset : CatchRuleset
{
}
}
6 changes: 3 additions & 3 deletions osu.Game.Rulesets.Mania.Tests/ManiaBeatmapConversionTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

namespace osu.Game.Rulesets.Mania.Tests
{
public class ManiaBeatmapConversionTest : BeatmapConversionTest<TestManiaRuleset, ConvertValue>
internal class ManiaBeatmapConversionTest : BeatmapConversionTest<TestManiaRuleset, ConvertValue>
{
protected override string ResourceAssembly => "osu.Game.Rulesets.Mania";

Expand All @@ -38,7 +38,7 @@ protected override IEnumerable<ConvertValue> CreateConvertValue(HitObject hitObj
protected override IBeatmapConverter CreateConverter(IBeatmap beatmap) => new ManiaBeatmapConverter(beatmap);
}

public struct ConvertValue : IEquatable<ConvertValue>
internal struct ConvertValue : IEquatable<ConvertValue>
{
/// <summary>
/// A sane value to account for osu!stable using ints everwhere.
Expand All @@ -55,7 +55,7 @@ public bool Equals(ConvertValue other)
&& Column == other.Column;
}

public class TestManiaRuleset : ManiaRuleset
internal class TestManiaRuleset : ManiaRuleset
{
}
}
6 changes: 3 additions & 3 deletions osu.Game.Rulesets.Osu.Tests/OsuBeatmapConversionTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

namespace osu.Game.Rulesets.Osu.Tests
{
public class OsuBeatmapConversionTest : BeatmapConversionTest<TestOsuRuleset, ConvertValue>
internal class OsuBeatmapConversionTest : BeatmapConversionTest<TestOsuRuleset, ConvertValue>
{
protected override string ResourceAssembly => "osu.Game.Rulesets.Osu";

Expand Down Expand Up @@ -45,7 +45,7 @@ protected override IEnumerable<ConvertValue> CreateConvertValue(HitObject hitObj
protected override IBeatmapConverter CreateConverter(IBeatmap beatmap) => new OsuBeatmapConverter(beatmap);
}

public struct ConvertValue : IEquatable<ConvertValue>
internal struct ConvertValue : IEquatable<ConvertValue>
{
/// <summary>
/// A sane value to account for osu!stable using ints everwhere.
Expand All @@ -68,7 +68,7 @@ public bool Equals(ConvertValue other)
&& Precision.AlmostEquals(EndY, other.EndY, conversion_lenience);
}

public class TestOsuRuleset : OsuRuleset
internal class TestOsuRuleset : OsuRuleset
{
}
}
6 changes: 3 additions & 3 deletions osu.Game.Rulesets.Taiko.Tests/TaikoBeatmapConversionTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

namespace osu.Game.Rulesets.Taiko.Tests
{
public class TaikoBeatmapConversionTest : BeatmapConversionTest<TestTaikoRuleset, ConvertValue>
internal class TaikoBeatmapConversionTest : BeatmapConversionTest<TestTaikoRuleset, ConvertValue>
{
protected override string ResourceAssembly => "osu.Game.Rulesets.Taiko";

Expand Down Expand Up @@ -43,7 +43,7 @@ protected override IEnumerable<ConvertValue> CreateConvertValue(HitObject hitObj
protected override IBeatmapConverter CreateConverter(IBeatmap beatmap) => new TaikoBeatmapConverter(beatmap);
}

public struct ConvertValue : IEquatable<ConvertValue>
internal struct ConvertValue : IEquatable<ConvertValue>
{
/// <summary>
/// A sane value to account for osu!stable using ints everwhere.
Expand All @@ -68,7 +68,7 @@ public bool Equals(ConvertValue other)
&& IsStrong == other.IsStrong;
}

public class TestTaikoRuleset : TaikoRuleset
internal class TestTaikoRuleset : TaikoRuleset
{
}
}
2 changes: 1 addition & 1 deletion osu.Game/Rulesets/RulesetStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ private static void loadRulesetFromFile(string file)
try
{
var assembly = Assembly.LoadFrom(file);
loaded_assemblies[assembly] = assembly.GetTypes().First(t => t.IsSubclassOf(typeof(Ruleset)));
loaded_assemblies[assembly] = assembly.GetTypes().First(t => t.IsPublic && t.IsSubclassOf(typeof(Ruleset)));
}
catch (Exception)
{
Expand Down