-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMatchForm.java
More file actions
executable file
·162 lines (144 loc) · 8.77 KB
/
MatchForm.java
File metadata and controls
executable file
·162 lines (144 loc) · 8.77 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
public class MatchForm extends Form {
public static final class Items {
public static final Item PRESENT = new Item(1, "Present", Item.Datatype.BOOLEAN);
public static final Item CAN_CLIMB = new Item(7, "Can climb?", Item.Datatype.BOOLEAN);
public static final Item COMMENTS = new Item(44, "Comments", Item.Datatype.STRING);
public static final Item RATE_DRIVING = new Item(79, "Rate driving", Item.Datatype.INTEGER);
public static final Item SHOOTS_HIGH = new Item(80, "Shoots High?", Item.Datatype.BOOLEAN);
public static final Item SHOOTS_LOW = new Item(81, "Shoots Low?", Item.Datatype.BOOLEAN);
public static final Item AUTO_HANDLE_GEARS = new Item(84, "Auto: Handle Gears?", Item.Datatype.BOOLEAN);
public static final Item AUTO_GEAR_SUCCESS = new Item(85, "Auto: Gear Success?", Item.Datatype.BOOLEAN);
public static final Item AUTO_GEAR_PLACEMENT = new Item(86, "Auto: Gear Placement", Item.Datatype.OPTIONS);
public static final Item AUTO_PILOT_PERFORMANCE = new Item(87, "Auto: Pilot Performance?", Item.Datatype.BOOLEAN);
public static final Item AUTO_SHOOTS_HIGH = new Item(88, "Auto: Shoots High?", Item.Datatype.BOOLEAN);
public static final Item AUTO_SHOOTS_LOW = new Item(89, "Auto: Shoots Low?", Item.Datatype.BOOLEAN);
public static final Item AUTO_SHOT_MAKES = new Item(90, "Auto: Shot Makes", Item.Datatype.INTEGER);
public static final Item AUTO_CROSS_BASELINE = new Item(91, "Auto: Cross Baseline?", Item.Datatype.BOOLEAN);
public static final Item STRATEGY = new Item(92, "Strategy", Item.Datatype.OPTIONS);
public static final Item SHOOTING_SPEED = new Item(93, "Shooting Speed", Item.Datatype.OPTIONS);
public static final Item SHOTS_MADE = new Item(94, "Shots Made", Item.Datatype.OPTIONS);
public static final Item SHOOTER_ACCURACY = new Item(95, "Shooter Accuracy", Item.Datatype.OPTIONS);
public static final Item HANDLE_GEARS = new Item(96, "Handle Gears?", Item.Datatype.BOOLEAN);
public static final Item PILOT_PERFORMANCE = new Item(97, "Pilot Performance", Item.Datatype.OPTIONS);
public static final Item GEAR_ATTEMPTS = new Item(98, "Gear Attempts", Item.Datatype.INTEGER);
public static final Item GEAR_MAKES = new Item(99, "Gear Makes", Item.Datatype.INTEGER);
public static final Item ROTORS_SPINNING = new Item(100, "Rotors Spinning", Item.Datatype.INTEGER);
public static final Item CLIMB_SUCCESS = new Item(101, "Climb Success?", Item.Datatype.BOOLEAN);
public static final Item STAYS_PUT_WHEN_POWER_CUT = new Item(102, "Stays Put When Power Cut?", Item.Datatype.BOOLEAN);
public static final Item CLIMBING_SPEED = new Item(103, "Climbing Speed", Item.Datatype.OPTIONS);
public static final Item DID_THEY_BREAK_DOWN = new Item(104, "Did They Break Down?", Item.Datatype.BOOLEAN);
public static final Item FOUL_POINTS = new Item(105, "Foul Points?", Item.Datatype.BOOLEAN);
public static final Item YELLOW_CARD = new Item(106, "Yellow Card?", Item.Datatype.BOOLEAN);
public static final Item RED_CARD = new Item(107, "Red Card?", Item.Datatype.BOOLEAN);
}
public static final Item[] matchItems = {
MatchForm.Items.AUTO_CROSS_BASELINE, MatchForm.Items.AUTO_GEAR_PLACEMENT,
MatchForm.Items.AUTO_GEAR_SUCCESS, MatchForm.Items.AUTO_HANDLE_GEARS,
MatchForm.Items.AUTO_PILOT_PERFORMANCE, MatchForm.Items.AUTO_SHOOTS_HIGH,
MatchForm.Items.AUTO_SHOOTS_LOW, MatchForm.Items.AUTO_SHOT_MAKES,
MatchForm.Items.CAN_CLIMB, MatchForm.Items.CLIMB_SUCCESS, MatchForm.Items.CLIMBING_SPEED,
MatchForm.Items.COMMENTS, MatchForm.Items.DID_THEY_BREAK_DOWN, MatchForm.Items.FOUL_POINTS,
MatchForm.Items.FOUL_POINTS, MatchForm.Items.GEAR_ATTEMPTS,
MatchForm.Items.GEAR_MAKES, MatchForm.Items.HANDLE_GEARS, MatchForm.Items.PILOT_PERFORMANCE,
MatchForm.Items.PRESENT, MatchForm.Items.RATE_DRIVING, MatchForm.Items.RED_CARD,
MatchForm.Items.ROTORS_SPINNING, MatchForm.Items.SHOOTER_ACCURACY,
MatchForm.Items.SHOOTING_SPEED, MatchForm.Items.SHOOTS_HIGH, MatchForm.Items.SHOOTS_LOW,
MatchForm.Items.SHOTS_MADE, MatchForm.Items.STAYS_PUT_WHEN_POWER_CUT, MatchForm.Items.STRATEGY,
MatchForm.Items.YELLOW_CARD, MatchForm.Items.RED_CARD
};
public static final class AUTO_GEAR_PLACEMENT {
public static final Option LEFT = new Option("Left", -1, 86);
public static final Option CENTER = new Option("Center", 0, 86);
public static final Option RIGHT = new Option("Right", 1, 86);
public static final Option NA = new Option("N/A", -2, 86);
}
public static final class STRATEGY {
public static final Option GEAR = new Option("Gear", 2, 92);
public static final Option FUEL = new Option("Fuel", 1, 92);
public static final Option DEFENSE = new Option("Defense", 0, 92);
}
public static final class SHOOTING_SPEED {
public static final Option SLOW = new Option("Slow", 0, 93);
public static final Option MEDIUM = new Option("Medium", 1, 93);
public static final Option FAST = new Option("Fast", 2, 93);
public static final Option NA = new Option("N/A", -2, 93);
}
public static final class SHOTS_MADE {
public static final Option FROM_0_TO_30 = new Option("0-30", 0, 94);
public static final Option FROM_31_TO_60 = new Option("31-60", 1, 94);
public static final Option FROM_61_TO_90 = new Option("61-90", 2, 94);
public static final Option FROM_90 = new Option("90+", 3, 94);
}
public static final class SHOOTER_ACCURACY {
public static final Option FROM_0_TO_25 = new Option("0-25%", 0, 95);
public static final Option FROM_26_TO_50 = new Option("26-50%", 1, 95);
public static final Option FROM_51_TO_75 = new Option("51-75%", 2, 95);
public static final Option FROM_76_TO_100 = new Option("76-100%", 3, 95);
}
public static final class PILOT_PERFORMANCE {
public static final Option GOOD = new Option("Good", 1, 97);
public static final Option BAD = new Option("Bad", 0, 97);
public static final Option NA = new Option("N/A", -2, 97);
}
public static final class CLIMBING_SPEED {
public static final Option FAST = new Option("Fast", 2, 103);
public static final Option MEDIUM = new Option("Medium", 1, 103);
public static final Option SLOW = new Option("Slow", 0, 103);
public static final Option NA = new Option("N/A", -2, 103);
}
public MatchForm(int tabletNum, int teamNum, int matchNum, String scoutName) {
super(FormType.MATCH_FORM, tabletNum, teamNum, matchNum, scoutName);
}
public MatchForm(int reportID, int tabletNum, int teamNum, int matchNum, String scoutName) {
super(reportID, FormType.MATCH_FORM, tabletNum, teamNum, matchNum, scoutName);
}
public MatchForm(String rawForm) {
super(rawForm);
}
public static String averageFormVisualizer(String rawData)
{
String visualizedForm = "";
String[] rawDataParts = rawData.split("\\##");
String averages = rawDataParts[0];
String proportions = rawDataParts[1];
String[] itemAvgs = averages.split("\\" + Form.ITEM_DELIMITER);
for (String itemAvg : itemAvgs)
{
String[] avgParts = itemAvg.split("\\,");
boolean matchScouting = false;
for (Item i : MatchForm.matchItems)
{
if (Integer.parseInt(avgParts[0]) == i.getId())
{
visualizedForm += i.getName() + ": ";
matchScouting = true;
}
}
if (!matchScouting) continue;
visualizedForm += avgParts[1] + "\n";
visualizedForm += "Standard Deviation: " + avgParts[2] + "\n";
visualizedForm += "Sample Size: " + avgParts[3] + "\n";
visualizedForm += "\n";
}
String[] itemProps = proportions.split("\\|");
for (String itemProp : itemProps)
{
String[] propParts = itemProp.split("\\,");
boolean matchScouting = false;
for (Item i : MatchForm.matchItems)
{
if (Integer.parseInt(propParts[0]) == i.getId())
{
visualizedForm += i.getName() + ": ";
matchScouting = true;
}
}
if (!matchScouting) continue;
visualizedForm += propParts[1] + "\n";
visualizedForm += "Sample Size: " + propParts[2] + "\n";
visualizedForm += "Success Rate: " + propParts[3] + "\n";
visualizedForm += "\n";
}
return visualizedForm;
}
}