-
Notifications
You must be signed in to change notification settings - Fork 0
/
ShuffleOptionManager.cs
161 lines (139 loc) · 5.34 KB
/
ShuffleOptionManager.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
#region using statements
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
#endregion
namespace DataJuggler.RandomShuffler.Core
{
#region class ShuffleOptionManager
/// <summary>
/// This class is used to keep track of options used by the RandomShuffler.
/// </summary>
public class ShuffleOptionManager
{
#region Private Variables
private int initializationShuffles;
private int beforeItemIsPulledShuffles;
private int afterItemIsPulledShuffles;
private double stopPercentage;
private int stopAtCount;
private const int DefaultInitializationShuffles = 3;
#endregion
#region Parameterized Constructor(int initializationShuffles = DefaultInitializationShuffles, int beforeItemIsPulledShuffles = 0, afterItemIsPulledShuffles = 0)
/// <summary>
/// Create a new instance of a ShuffleOptionManager
/// </summary>
/// <param name="initializationShuffles"></param>
/// <param name="beforeItemIsPulledShuffles"></param>
/// <param name="?"></param>
public ShuffleOptionManager(int initializationShuffles = DefaultInitializationShuffles, int beforeItemIsPulledShuffles = 0, int afterItemIsPulledShuffles = 0)
{
// Store the parameters
this.InitializationShuffles = initializationShuffles;
this.BeforeItemIsPulledShuffles = beforeItemIsPulledShuffles;
this.AfterItemIsPulledShuffles = afterItemIsPulledShuffles;
}
#endregion
#region Properties
#region AfterItemIsPulledShuffles
/// <summary>
/// This property gets or sets the value for 'AfterItemIsPulledShuffles'.
/// </summary>
public int AfterItemIsPulledShuffles
{
get { return afterItemIsPulledShuffles; }
set { afterItemIsPulledShuffles = value; }
}
#endregion
#region BeforeItemIsPulledShuffles
/// <summary>
/// This property gets or sets the value for 'BeforeItemIsPulledShuffles'.
/// </summary>
public int BeforeItemIsPulledShuffles
{
get { return beforeItemIsPulledShuffles; }
set { beforeItemIsPulledShuffles = value; }
}
#endregion
#region HasAfterItemIsPulledShuffles
/// <summary>
/// This property returns true if the 'AfterItemIsPulledShuffles' is set.
/// </summary>
public bool HasAfterItemIsPulledShuffles
{
get
{
// initial value
bool hasAfterItemIsPulledShuffles = (this.AfterItemIsPulledShuffles > 0);
// return value
return hasAfterItemIsPulledShuffles;
}
}
#endregion
#region HasBeforeItemIsPulledShuffles
/// <summary>
/// This property returns true if the 'BeforeItemIsPulledShuffles' is set.
/// </summary>
public bool HasBeforeItemIsPulledShuffles
{
get
{
// initial value
bool hasBeforeItemIsPulledShuffles = (this.BeforeItemIsPulledShuffles > 0);
// return value
return hasBeforeItemIsPulledShuffles;
}
}
#endregion
#region HasInitializationShuffles
/// <summary>
/// This property returns true if the 'InitializationShuffles' is set.
/// </summary>
public bool HasInitializationShuffles
{
get
{
// initial value
bool hasInitializationShuffles = (this.InitializationShuffles > 0);
// return value
return hasInitializationShuffles;
}
}
#endregion
#region InitializationShuffles
/// <summary>
/// This property gets or sets the value for 'InitializationShuffles'.
/// </summary>
public int InitializationShuffles
{
get {return initializationShuffles; }
set { initializationShuffles = value; }
}
#endregion
#region StopAtCount
/// <summary>
/// This property gets or sets the value for 'StopAtCount'.
/// </summary>
public int StopAtCount
{
get { return stopAtCount; }
set { stopAtCount = value; }
}
#endregion
#region StopPercentage
/// <summary>
/// This property gets or sets the value for 'StopPercentage'.
/// </summary>
public double StopPercentage
{
get { return stopPercentage; }
set { stopPercentage = value; }
}
#endregion
#endregion
}
#endregion
}