-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathProgram.cs
More file actions
352 lines (269 loc) · 14.9 KB
/
Program.cs
File metadata and controls
352 lines (269 loc) · 14.9 KB
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
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace AATF_15
{
public static class variables
{
static uint _errors;
public static uint errors
{
get
{
return _errors;
}
set
{
_errors = value;
}
}
}
public static class pasta
{
public const string navyseals = "What the fuck did you just fucking say about me, you little bitch? I’ll have you know I graduated top of my class in the Navy Seals, and I’ve been involved in numerous secret raids on Al-Quaeda, and I have over 300 confirmed kills. I am trained in gorilla warfare and I’m the top sniper in the entire US armed forces. You are nothing to me but just another target. I will wipe you the fuck out with precision the likes of which has never been seen before on this Earth, mark my fucking words. You think you can get away with saying that shit to me over the Internet? Think again, fucker. As we speak I am contacting my secret network of spies across the USA and your IP is being traced right now so you better prepare for the storm, maggot. The storm that wipes out the pathetic little thing you call your life. You’re fucking dead, kid. I can be anywhere, anytime, and I can kill you in over seven hundred ways, and that’s just with my bare hands. Not only am I extensively trained in unarmed combat, but I have access to the entire arsenal of the United States Marine Corps and I will use it to its full extent to wipe your miserable ass off the face of the continent, you little shit. If only you could have known what unholy retribution your little “clever” comment was about to bring down upon you, maybe you would have held your fucking tongue. But you couldn’t, you didn’t, and now you’re paying the price, you goddamn idiot. I will shit fury all over you and you will drown in it. You’re fucking dead, kiddo.";
}
public static class constants
{
public const uint players_per_team = 23;
public const uint stats_gold = 99;
public const uint stats_silver = 88;
public const uint stats_regular = 77;
public const uint stats_goalkeeper = 77;
// Summer 2015 Ruleset - All players above 189cm in height get a variable stat nerf
public const uint stats_gold_system1 = 94;
public const uint stats_silver_system1 = 84;
public const uint stats_regular_system1 = 74;
public const uint stats_goalkeeper_system1 = 74;
public const uint form_gold = 8;
public const uint form_silver = 8;
public const uint form_regular = 4;
public const uint form_goalkeeper = 4;
public const uint weakfoot_accuracy = 2;
public const uint weakfoot_usage = 2;
public const uint weakfoot_manlet_height = 179;
public const uint weakfoot_accuracy_manlet = 4;
public const uint weakfoot_usage_manlet = 4;
public const uint injury_tolerance = 3;
public const uint cards_limit_goalkeeper = 1;
public const uint cards_limit_regular = 2;
public const uint cards_limit_silver = 3;
public const uint cards_limit_gold = 4;
public const uint positions_minimum_gk = 2;
public const uint positions_minimum_def = 2;
public const uint positions_minimum_mf = 1;
public const uint positions_minimum_fw = 1;
public const uint players_gold = 2;
public const uint players_silver = 2;
public const uint players_regular_and_gk = 19;
public const uint height_maximum_pes = 210;
public const uint height_maximum_4cc = 205;
public const uint height_bracket_1 = 200;
public const uint height_bracket_2 = 195;
public const uint height_bracket_3 = 190;
public const uint height_bracket_4 = 185;
public const uint height_bracket_5 = 180;
public const uint height_bracket_6 = 175;
public const uint height_bracket_7 = 170;
public const uint height_bracket_8 = 165;
public const uint height_minimum_pes = 148;
// Height Abuse
// System 1
public const uint system1_height_bracket_1_limit = 1;
public const uint system1_height_bracket_2_limit = 1;
public const uint system1_height_bracket_3_limit = 2;
public const uint system1_height_bracket_4_limit = 6;
public const uint system1_height_limit_total = 4200;
// System 2
public const uint system2_height_bracket_1_limit = 0;
public const uint system2_height_bracket_2_limit = 0;
public const uint system2_height_bracket_3_limit = 0;
public const uint system2_height_bracket_4_limit = 10;
public const uint system2_height_limit_total = 4165;
// Both
public const uint height_bracket_5_limit = 7;
public const uint height_bracket_6_limit = 3;
public const uint height_bracket_7_limit = 2;
public const uint height_bracket_8_limit = 1;
// Age Abuse
public const uint age_maximum = 50;
public const uint age_minimum = 15;
}
public class team
{
public string team_name;
public int teamID;
public int captains;
public List<player> team_players = new List<player>();
// DEBUG - list of player names
public List<string> team_names = new List<string>();
}
class Program
{
public static int Count_Bool(params bool[] args)
{
return args.Count(t => t);
}
static void Main(string[] args)
{
variables.errors = 0;
bool ini_setup = false;
Console.Title = "autoATF - PES 2015 - Autumn 2015 Edition - v2.1";
// INI setup
ini_setup = Parser.setup_switches();
// Only continue if the ini setup was successful, otherwise there will be no input file and the csv parser will fall over
if (ini_setup)
{
// Are we checking, or comparing?
// The compare_file should be blank if we're checking, and have a file if we're comparing
if (switches.compare_file == "")
{
// *** Checking ***
Console.WriteLine("Entering Checker Mode...\n");
// Is it an edit.bin, or a texport.bin?
if (Importer.is_edit_bin(switches.input_file))
{
List<player> player_table = new List<player>();
// Parse the edit.bin
player_table = Importer.save_importer(switches.input_file);
while (true)
{
team squad = new team();
// What team to check?
checker.team_input(squad);
// Construct that team
checker.teambuilding(player_table, squad);
// Check that team
checker.check_em(squad);
// Reset the error count for the next team
variables.errors = 0;
}
}
else // Its a texport.bin
{
team squad = new team();
// Parse the texport.bin
squad = Importer.export_importer(switches.input_file);
Console.WriteLine("Team Export:\t" + squad.team_name);
Console.WriteLine();
// Check that the players are meant to be on that team
checker.check_squad_consistency(squad);
// Check that team
checker.check_em(squad);
}
}
else
{
// *** Comparing ***
Console.WriteLine("Entering Compare Mode...\n");
// What team are we comparing?
// If one of the files is an export, we can assume that one
int type = -1; // 0 - Save/Save, 1 - Save/Export, 2 - Export/Save, 3 - Export/Export, -1 - ERROR
type = comparer.get_compare_type();
// So now we know what setup we have, lets start parsing the files
switch (type)
{
case 0: // Save/Save
// This is the only type that can loop infinitely, as you can check a different team every time
while (true)
{
team t0_squad_save_1 = new team();
team t0_squad_save_2 = new team();
// Parse the saves
List<player> t0_player_table_1 = new List<player>();
List<player> t0_player_table_2 = new List<player>();
t0_player_table_1 = Importer.save_importer(switches.input_file);
t0_player_table_2 = Importer.save_importer(switches.compare_file);
// What team to check?
checker.team_input(t0_squad_save_1);
t0_squad_save_2.teamID = t0_squad_save_1.teamID;
t0_squad_save_2.team_name = t0_squad_save_1.team_name;
// Construct the two teams
checker.teambuilding(t0_player_table_1, t0_squad_save_1);
checker.teambuilding(t0_player_table_2, t0_squad_save_2);
// Compare the teams
comparer.compare_teams(t0_squad_save_1, t0_squad_save_2);
Console.WriteLine();
Console.WriteLine("Differences: " + variables.errors);
Console.WriteLine("Compare completed!");
Console.WriteLine();
}
break;
case 1: // Save/Export
team t1_squad_save = new team();
team t1_squad_export = new team();
// Parse the texport.bin
t1_squad_export = Importer.export_importer(switches.compare_file);
Console.WriteLine();
Console.WriteLine("Comparing " + t1_squad_export.team_name);
Console.WriteLine();
// Now we know what team we're using, parse the edit.bin
List<player> t1_player_table = new List<player>();
t1_player_table = Importer.save_importer(switches.input_file);
t1_squad_save.teamID = t1_squad_export.teamID;
t1_squad_save.team_name = t1_squad_export.team_name;
// Construct that team
checker.teambuilding(t1_player_table, t1_squad_save);
// Compare the teams
comparer.compare_teams(t1_squad_save, t1_squad_export);
break;
case 2: // Export/Save
team t2_squad_save = new team();
team t2_squad_export = new team();
// Parse the texport.bin
t2_squad_export = Importer.export_importer(switches.input_file);
Console.WriteLine();
Console.WriteLine("Comparing " + t2_squad_export.team_name);
Console.WriteLine();
// Now we know what team we're using, parse the edit.bin
List<player> t2_player_table = new List<player>();
t2_player_table = Importer.save_importer(switches.compare_file);
t2_squad_save.teamID = t2_squad_export.teamID;
t2_squad_save.team_name = t2_squad_export.team_name;
// Construct that team
checker.teambuilding(t2_player_table, t2_squad_save);
// Compare the teams
comparer.compare_teams(t2_squad_save, t2_squad_export);
break;
case 3: // Export/Export
team t3_squad_export_1 = new team();
team t3_squad_export_2 = new team();
// Parse the texport.bins
t3_squad_export_1 = Importer.export_importer(switches.input_file);
t3_squad_export_2 = Importer.export_importer(switches.compare_file);
// Are they exports for the same team?
if (t3_squad_export_1.teamID != t3_squad_export_2.teamID)
{
Console.WriteLine("\nThe two exports have different teams! Cancelling comparison");
Console.WriteLine("\t\t(" + t3_squad_export_1.team_name + " and " + t3_squad_export_2.team_name + ")");
}
else
{
Console.WriteLine();
Console.WriteLine("Comparing " + t3_squad_export_1.team_name);
Console.WriteLine();
// Compare the teams
comparer.compare_teams(t3_squad_export_1, t3_squad_export_2);
}
break;
default:
// Oh shit nigga what are you doing
Console.WriteLine();
Console.WriteLine("Invalid input files");
Console.WriteLine("You really shouldn't be seeing this error. If you are, you dun goof'd somehow");
Console.WriteLine("Check the ini is pointing at the correct files");
Console.WriteLine();
break;
}
Console.WriteLine();
Console.WriteLine("Differences: " + variables.errors);
Console.WriteLine("Compare completed!");
Console.WriteLine();
}
}
Console.WriteLine("Press Enter to Exit...");
Console.ReadLine();
}
}
}