Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ClusterM/hakchi2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2017-02-07 00:23:49 +0300
committerAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2017-02-07 00:23:49 +0300
commit7217e5882968829703a13aedcff424c31ca24094 (patch)
tree7dd854020bdea41dd55e504c865bbe61faa9cfb2 /NesMenuFolder.cs
parenta2197a6cb42d511747ccd2159cf1f4d29ef15f07 (diff)
Optimization, optimization, optimization
Diffstat (limited to 'NesMenuFolder.cs')
-rw-r--r--NesMenuFolder.cs74
1 files changed, 56 insertions, 18 deletions
diff --git a/NesMenuFolder.cs b/NesMenuFolder.cs
index d7f76bf5..c227644c 100644
--- a/NesMenuFolder.cs
+++ b/NesMenuFolder.cs
@@ -14,7 +14,15 @@ namespace com.clusterrr.hakchi_gui
{
static Random rnd = new Random();
private string code = null;
- private bool first = true;
+ public enum Priority
+ {
+ Back = 0,
+ Left = 1,
+ Right = 2,
+ End = 3
+ }
+ private Priority position;
+ //private bool first = true;
public string Code
{
@@ -27,7 +35,24 @@ namespace com.clusterrr.hakchi_gui
{
get
{
- return (first ? ' ' : 'Я') + name;
+ char prefix;
+ switch (position)
+ {
+ case Priority.Back:
+ prefix = (char)1;
+ break;
+ default:
+ case Priority.Left:
+ prefix = (char)2;
+ break;
+ case Priority.Right:
+ prefix = 'Ю';
+ break;
+ case Priority.End:
+ prefix = 'Я';
+ break;
+ }
+ return prefix + name;
}
set
{
@@ -62,30 +87,43 @@ namespace com.clusterrr.hakchi_gui
string Publisher = new String('!', 10);
// It's workaround for sorting
- public bool First
+ public Priority Position
{
set
{
// Sort to left
- if (value)
- {
- Players = 2;
- Simultaneous = 1;
- ReleaseDate = "0000-00-00";
- Publisher = new String('!', 10);
- }
- else // Sort to right
+ position = value;
+ switch (position)
{
- Players = 1;
- Simultaneous = 0;
- ReleaseDate = "9999-99-99";
- Publisher = new String('Z', 10);
+ case Priority.Back:
+ Players = 2;
+ Simultaneous = 1;
+ ReleaseDate = "0000-00-00";
+ Publisher = new String((char)1, 10);
+ break;
+ case Priority.Left:
+ Players = 2;
+ Simultaneous = 1;
+ ReleaseDate = "1111-11-11";
+ Publisher = new String((char)2, 10);
+ break;
+ case Priority.Right:
+ Players = 1;
+ Simultaneous = 0;
+ ReleaseDate = "8888-88-88";
+ Publisher = new String('Y', 10);
+ break;
+ case Priority.End:
+ Players = 1;
+ Simultaneous = 0;
+ ReleaseDate = "9999-99-99";
+ Publisher = new String('Z', 10);
+ break;
}
- first = value;
}
get
{
- return first;
+ return position;
}
}
@@ -93,7 +131,7 @@ namespace com.clusterrr.hakchi_gui
{
Code = GenerateCode((uint)rnd.Next());
Name = "Folder";
- First = true;
+ Position = Priority.Left;
}
public Image Image