-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCompletedAction.cs
253 lines (234 loc) · 8.94 KB
/
CompletedAction.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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
using System.Text;
using ScriptsOfTribute.Board.Cards;
namespace ScriptsOfTribute.Board;
public enum CompletedActionType
{
BUY_CARD,
ACQUIRE_CARD,
PLAY_CARD,
ACTIVATE_AGENT,
ACTIVATE_PATRON,
ATTACK_AGENT,
AGENT_DEATH,
GAIN_COIN,
GAIN_POWER,
GAIN_PRESTIGE,
OPP_LOSE_PRESTIGE,
REPLACE_TAVERN,
DESTROY_CARD,
DRAW,
DISCARD,
REFRESH,
TOSS,
KNOCKOUT,
ADD_PATRON_CALLS,
ADD_SUMMERSET_SACKING,
ADD_BEWILDERMENT_TO_OPPONENT,
ADD_WRIT_OF_COIN,
HEAL_AGENT,
END_TURN,
}
public class CompletedAction
{
public readonly PlayerEnum Player;
public readonly CompletedActionType Type;
public readonly UniqueCard? SourceCard;
public readonly UniqueCard? TargetCard;
public readonly PatronId? SourcePatron;
public readonly int Combo = 1;
public readonly int Amount = 1;
public CompletedAction(CompletedActionType type)
{
Type = type;
}
public CompletedAction(PlayerEnum player, CompletedActionType type, UniqueCard sourceCard, int amount)
{
Player = player;
Type = type;
SourceCard = sourceCard;
Amount = amount;
}
public CompletedAction(PlayerEnum player, CompletedActionType type, UniqueCard? sourceCard, int amount, UniqueCard targetCard)
{
Player = player;
Type = type;
SourceCard = sourceCard;
Amount = amount;
TargetCard = targetCard;
}
public CompletedAction(PlayerEnum player, CompletedActionType type, UniqueCard sourceCard, UniqueCard targetCard)
{
Player = player;
Type = type;
SourceCard = sourceCard;
TargetCard = targetCard;
}
public CompletedAction(PlayerEnum player, CompletedActionType type, PatronId sourcePatron, UniqueCard targetCard)
{
Player = player;
Type = type;
SourcePatron = sourcePatron;
TargetCard = targetCard;
}
public CompletedAction(PlayerEnum player, CompletedActionType type, PatronId sourcePatron, int amount)
{
Player = player;
Type = type;
SourcePatron = sourcePatron;
Amount = amount;
}
public CompletedAction(PlayerEnum player, CompletedActionType type, PatronId sourcePatron, int amount, UniqueCard targetCard)
{
Player = player;
Type = type;
SourcePatron = sourcePatron;
Amount = amount;
TargetCard = targetCard;
}
public CompletedAction(PlayerEnum player, CompletedActionType type, UniqueCard targetCard)
{
Player = player;
Type = type;
TargetCard = targetCard;
}
public CompletedAction(PlayerEnum player, CompletedActionType type, PatronId sourcePatronId)
{
Player = player;
Type = type;
SourcePatron = sourcePatronId;
}
public override string ToString()
{
var sb = new StringBuilder();
switch (Type)
{
case CompletedActionType.BUY_CARD:
sb.Append($"Buy Card - {TargetCard}");
break;
case CompletedActionType.ACQUIRE_CARD:
sb.Append($"Acquire Card - Source: {SourceCard}{SourcePatron} Target: {TargetCard}");
break;
case CompletedActionType.PLAY_CARD:
sb.Append($"Play Card - {TargetCard}");
break;
case CompletedActionType.ACTIVATE_AGENT:
sb.Append($"Activate Agent - {TargetCard}");
break;
case CompletedActionType.ACTIVATE_PATRON:
sb.Append($"Activate Patron - {SourcePatron}");
break;
case CompletedActionType.ATTACK_AGENT:
sb.Append($"Attack Agent - {TargetCard} for {Amount}");
break;
case CompletedActionType.AGENT_DEATH:
sb.Append($"Agent Death - {TargetCard}");
break;
case CompletedActionType.GAIN_COIN:
sb.Append($"Gain Coin - Amount: {Amount} Source: {SourceCard}{SourcePatron}");
break;
case CompletedActionType.GAIN_POWER:
sb.Append($"Gain Power - Amount: {Amount} Source: {SourceCard}{SourcePatron}");
break;
case CompletedActionType.GAIN_PRESTIGE:
sb.Append($"Gain Prestige - Amount: {Amount} Source: {SourceCard}{SourcePatron}");
break;
case CompletedActionType.OPP_LOSE_PRESTIGE:
sb.Append($"Opp Lose Prestige - Amount: {Amount} Source: {SourceCard}{SourcePatron}");
break;
case CompletedActionType.REPLACE_TAVERN:
sb.Append($"Replace Tavern - Source: {SourceCard}{SourcePatron} Target: {TargetCard}");
break;
case CompletedActionType.DESTROY_CARD:
sb.Append($"Destroy Card - Source: {SourceCard}{SourcePatron} Target: {TargetCard}");
break;
case CompletedActionType.DRAW:
sb.Append($"Draw - Amount: {Amount} Source: {SourceCard}{SourcePatron}");
break;
case CompletedActionType.DISCARD:
sb.Append($"Discard - Source: {SourceCard}{SourcePatron} Target: {TargetCard}");
break;
case CompletedActionType.REFRESH:
sb.Append($"Refresh - Source: {SourceCard}{SourcePatron} Target: {TargetCard}");
break;
case CompletedActionType.TOSS:
sb.Append($"Toss - Source: {SourceCard}{SourcePatron} Target: {TargetCard}");
break;
case CompletedActionType.KNOCKOUT:
sb.Append($"Knockout - Source: {SourceCard}{SourcePatron} Target: {TargetCard}");
break;
case CompletedActionType.ADD_SUMMERSET_SACKING:
sb.Append($"Add Summerset Sacking - Source: {SourceCard}{SourcePatron}");
break;
case CompletedActionType.ADD_BEWILDERMENT_TO_OPPONENT:
sb.Append($"Add Bewilderment To Opponent - Source: {SourceCard}{SourcePatron}");
break;
case CompletedActionType.HEAL_AGENT:
sb.Append($"Heal Agent: Amount: {Amount} Agent: {TargetCard} Source: {SourceCard}{SourcePatron}");
break;
case CompletedActionType.END_TURN:
sb.Append("End Turn");
break;
case CompletedActionType.ADD_PATRON_CALLS:
sb.Append($"Increment patron calls - Amount: {Amount} Source: {SourceCard}{SourcePatron}");
break;
case CompletedActionType.ADD_WRIT_OF_COIN:
sb.Append($"Add Writ Of Coin - Source {SourceCard}{SourcePatron}");
break;
default:
throw new ArgumentOutOfRangeException();
}
return sb.ToString();
}
public string SimpleString()
{
var sb = new StringBuilder();
sb.Append(Type.ToString());
switch (Type)
{
case CompletedActionType.BUY_CARD:
case CompletedActionType.PLAY_CARD:
case CompletedActionType.ACTIVATE_AGENT:
case CompletedActionType.AGENT_DEATH:
sb.Append($"{TargetCard}");
break;
case CompletedActionType.ACQUIRE_CARD:
sb.Append($"{SourceCard}{SourcePatron} {TargetCard}");
break;
case CompletedActionType.ACTIVATE_PATRON:
sb.Append($"{SourcePatron}");
break;
case CompletedActionType.ATTACK_AGENT:
sb.Append($"{TargetCard} {Amount}");
break;
case CompletedActionType.GAIN_COIN:
case CompletedActionType.GAIN_POWER:
case CompletedActionType.GAIN_PRESTIGE:
case CompletedActionType.OPP_LOSE_PRESTIGE:
case CompletedActionType.DRAW:
case CompletedActionType.ADD_PATRON_CALLS:
sb.Append($"{SourceCard}{SourcePatron} {Amount}");
break;
case CompletedActionType.REPLACE_TAVERN:
case CompletedActionType.DESTROY_CARD:
case CompletedActionType.DISCARD:
case CompletedActionType.REFRESH:
case CompletedActionType.TOSS:
case CompletedActionType.KNOCKOUT:
sb.Append($"{SourceCard}{SourcePatron} {TargetCard}");
break;
case CompletedActionType.ADD_SUMMERSET_SACKING:
case CompletedActionType.ADD_BEWILDERMENT_TO_OPPONENT:
case CompletedActionType.ADD_WRIT_OF_COIN:
sb.Append($"{SourceCard}{SourcePatron}");
break;
case CompletedActionType.HEAL_AGENT:
sb.Append($"{SourceCard}{SourcePatron} {TargetCard} {Amount}");
break;
case CompletedActionType.END_TURN:
break;
default:
throw new ArgumentOutOfRangeException();
}
return sb.ToString();
}
}