mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-01-11 14:25:35 +00:00
ExampleAttribute.ToString() now ignores ExampleAttribute.Difficulty if it is zero. Simplified ExampleAttribute constructors.
This commit is contained in:
parent
4534c9ec19
commit
e43203675e
|
@ -19,12 +19,11 @@ namespace Examples
|
|||
public readonly int Difficulty;
|
||||
public readonly bool Visible = true;
|
||||
|
||||
public ExampleAttribute(string title, ExampleCategory category)
|
||||
: this(title, category, 0, true) { }
|
||||
|
||||
public ExampleAttribute(string title, ExampleCategory category, int difficulty)
|
||||
{
|
||||
this.Title = title;
|
||||
this.Category = category;
|
||||
this.Difficulty = difficulty;
|
||||
}
|
||||
: this(title, category, difficulty, true) { }
|
||||
|
||||
public ExampleAttribute(string title, ExampleCategory category, int difficulty, bool visible)
|
||||
{
|
||||
|
@ -36,17 +35,20 @@ namespace Examples
|
|||
|
||||
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
|
||||
{
|
||||
OpenGL,
|
||||
OpenGL = 0,
|
||||
OpenAL,
|
||||
Tutorial,
|
||||
GLSL,
|
||||
WinForms,
|
||||
Test,
|
||||
Last
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue