-
Notifications
You must be signed in to change notification settings - Fork 0
/
GAME.Method.cs
114 lines (102 loc) · 3.11 KB
/
GAME.Method.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
using System.Drawing;
using System.Windows.Forms;
namespace YINSH
{
public partial class MainForm : Form
{
#region 인스턴스
readonly Map map = Map.GetInstance();
readonly Turn turn = Turn.GetInstance();
readonly Component component = Component.GetInstance();
readonly Score score = Score.GetInstance();
#endregion
#region 변수
readonly string[] version = { "Original", "Blitz" };
bool Version(string mode, int winscore)
{
if (comboBox1.Items[comboBox1.SelectedIndex].ToString() == mode)
{
for (var i = 0; i < score.Player.Length; i++)
{
if (score.Player[i] == winscore)
{
return true;
}
}
}
return false;
}
bool Start;
bool End()
{
if (Version("Original", 3)) { return true; }
if (Version("Blitz", 1)) { return true; }
return false;
}
#endregion
#region 함수
void Setting()
{
comboBox1.Items.AddRange(version);
comboBox1.SelectedIndex = 0;
Start = false;
Size size = panel.Size;
int length = (Map.Size * 2) + 1;
// Map: Board, Point Set & Draw Map;
// Turn: Clear
// Component: Layer, Ring, Marker, Cursor;
// Score: Layer, End;
map.System(size, length);
turn.Setting();
component.Setting(size, length);
score.Setting(size);
}
/// <summary>
/// Test Label
/// </summary>
void TextTest()
{
string ready = (turn.Count == 0) ? "[Ready]" : "[Play]";
string Ring = string.Empty;
string Marker = "Marker: " + component.Marker_Quantity;
string Turn = (turn.Count == 0) ? string.Empty : " (Turn: " + turn.Count + ")";
if (ready == "[Ready]")
{
Ring = "\r\nWhite Ring: " + component.Ring_Quantity[0] + "\r\nBlack Ring: " + component.Ring_Quantity[1];
}
else
{
if (turn.Player[turn.User] == Color.White)
{
Ring = " White ";
}
if (turn.Player[turn.User] == Color.Black)
{
Ring = " Black ";
}
}
label2.Text = ready + Marker + Ring + Turn;
if (End())
{
label2.Text = "End";
}
}
void Image()
{
using (Graphics g = panel.CreateGraphics())
{
g.DrawImage(map.Board, Point.Empty);
g.DrawImage(component.Layer, Point.Empty);
g.DrawImage(score.Layer, Point.Empty);
}
}
void Rule()
{
component.System();
turn.System();
score.System();
this.Refresh();
}
#endregion
}
}