mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-07-06 10:20:42 +00:00
ExampleAttribute.ToString() now ignores ExampleAttribute.Difficulty if it is zero. Simplified ExampleAttribute constructors.
This commit is contained in:
parent
3930dce721
commit
65019c5c53
|
@ -19,12 +19,11 @@ namespace Examples
|
||||||
public readonly int Difficulty;
|
public readonly int Difficulty;
|
||||||
public readonly bool Visible = true;
|
public readonly bool Visible = true;
|
||||||
|
|
||||||
|
public ExampleAttribute(string title, ExampleCategory category)
|
||||||
|
: this(title, category, 0, true) { }
|
||||||
|
|
||||||
public ExampleAttribute(string title, ExampleCategory category, int difficulty)
|
public ExampleAttribute(string title, ExampleCategory category, int difficulty)
|
||||||
{
|
: this(title, category, difficulty, true) { }
|
||||||
this.Title = title;
|
|
||||||
this.Category = category;
|
|
||||||
this.Difficulty = difficulty;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ExampleAttribute(string title, ExampleCategory category, int difficulty, bool visible)
|
public ExampleAttribute(string title, ExampleCategory category, int difficulty, bool visible)
|
||||||
{
|
{
|
||||||
|
@ -36,17 +35,20 @@ namespace Examples
|
||||||
|
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
return String.Format("{0} {1}: {2}", Category, Difficulty, Title);
|
if (Difficulty != 0)
|
||||||
|
return String.Format("{0} {1}: {2}", Category, Difficulty, Title);
|
||||||
|
return String.Format("{0}: {1}", Category, Title);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum ExampleCategory
|
public enum ExampleCategory
|
||||||
{
|
{
|
||||||
OpenGL,
|
OpenGL = 0,
|
||||||
OpenAL,
|
OpenAL,
|
||||||
Tutorial,
|
Tutorial,
|
||||||
GLSL,
|
GLSL,
|
||||||
WinForms,
|
WinForms,
|
||||||
Test,
|
Test,
|
||||||
|
Last
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue