Skip to content

Commit 0dbf45e

Browse files
committed
Remove more unused code
1 parent 4fbb4bd commit 0dbf45e

File tree

4 files changed

+2
-172
lines changed

4 files changed

+2
-172
lines changed

src/data/Rules.java

+1-78
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ public abstract class Rules
1212
{
1313
/** Note all league's rules here to have them available. */
1414
public static final Rules[] LEAGUES = {
15-
new SPL(),
16-
new SPLPenaltyShootout()
15+
new SPL()
1716
};
1817

1918
/**
@@ -36,84 +35,8 @@ public static Rules getLeagueRules(final Class<? extends Rules> c) {
3635
public String leagueDirectory;
3736
/** How many robots are in a team. */
3837
public int teamSize;
39-
/** How many robots of each team may play at one time. */
40-
public int robotsPlaying;
4138
/** The Java Colors the left and the right team starts with. */
4239
public Color[] teamColor;
43-
/** The name of the colors. */
44-
public String[] teamColorName;
45-
/** If the clock may stop in certain states (Ready, Set) in a play-off game. */
46-
public boolean playOffTimeStop;
4740
/** Time in seconds one half is long. */
4841
public int halfTime;
49-
/** Time in seconds the ready state is long. */
50-
public int readyTime;
51-
/** Time in seconds between first and second half. */
52-
public int pauseTime;
53-
/** If left and right side may both have the first kickoff. */
54-
public boolean kickoffChoice;
55-
/** Time in seconds the ball is blocked after kickoff. */
56-
public int kickoffTime;
57-
/** Time in seconds the ball is blocked after a free kick. */
58-
public int freeKickTime;
59-
/** Time in seconds the the ready state during a penalty kick is long. */
60-
public int penaltyKickReadyTime;
61-
/** Time in seconds before a global game stuck can be called. */
62-
public int minDurationBeforeStuck;
63-
/** The number of seconds switching to Playing is delayed. */
64-
public int delayedSwitchToPlaying;
65-
/** The number of seconds switching to Ready after a goal is delayed. */
66-
public int delayedSwitchAfterGoal;
67-
/** If there is an overtime before the penalty shoot-out in a play-off game. */
68-
public boolean overtime;
69-
/** Time in seconds one overtime half is long. */
70-
public int overtimeTime;
71-
/** If the game starts with penalty-shots. */
72-
public boolean startWithPenalty;
73-
/** Time in seconds between second half and penalty shoot-out. */
74-
public int pausePenaltyShootOutTime;
75-
/** Time in seconds one penalty shoot is long. */
76-
public int penaltyShotTime;
77-
/** If there can be a penalty-shot retry. */
78-
public boolean penaltyShotRetries;
79-
/** If there is a sudden-death. */
80-
public boolean suddenDeath;
81-
/** Time in seconds one penalty shoot is long in sudden-death. */
82-
public int penaltyShotTimeSuddenDeath;
83-
/** Number of penalty-shots for each team. */
84-
public int numberOfPenaltyShots;
85-
/** Time in seconds for each kind of penalty. */
86-
public int[] penaltyTime;
87-
/** Time in seconds to increment penalties. */
88-
public int penaltyIncreaseTime;
89-
/** Whether the penalty count is reset on halftime */
90-
public boolean resetPenaltyCountOnHalftime;
91-
/** Whether penalties can be removed before the penalty time has passed. */
92-
public boolean allowEarlyPenaltyRemoval;
93-
/** Penalty that players get when they substitute another player. */
94-
public byte substitutePenalty;
95-
/** if robots should return from penalties when the game state changes. */
96-
public boolean returnRobotsInGameStoppages;
97-
/** Time in seconds one team has as timeOut. */
98-
public int timeOutTime;
99-
/** Time in seconds of a referee timeout. */
100-
public int refereeTimeout;
101-
/** Defines if the option for a referee timeout is available. */
102-
public boolean isRefereeTimeoutAvailable;
103-
/** One time-out per half? */
104-
public boolean timeOutPerHalf;
105-
/** Allowed to compensate for lost time? */
106-
public boolean lostTime;
107-
/** If true, the game controller should drop broadcast-messages */
108-
public boolean dropBroadcastMessages;
109-
/** The type of the competition (COMPETITION_TYPE_NORMAL, COMPETITION_TYPE_CHALLENGE_SHIELD, etc) */
110-
public byte competitionType;
111-
/** Number of hardware penalties per half before the robot is ejected. */
112-
public int allowedHardwarePenaltiesPerHalf;
113-
/** Number of hardware penalties per game before the robot is ejected. */
114-
public int allowedHardwarePenaltiesPerGame;
115-
/** Number of team messages a team is allowed to send per game. */
116-
public short overallMessageBudget;
117-
/** Number of team messages that are added to the budget per minute of extra time. */
118-
public short additionalMessageBudgetPerMinute;
11942
}

src/data/SPL.java

-76
Original file line numberDiff line numberDiff line change
@@ -17,85 +17,9 @@ public class SPL extends Rules
1717
leagueDirectory = "spl";
1818
/* How many robots are in a team. */
1919
teamSize = 6; // 5 players + 1 sub
20-
/* How many robots of each team may play at one time. */
21-
robotsPlaying = 5;
2220
/* The Java Colors the left and the right team starts with. */
2321
teamColor = new Color[] {Color.BLUE, Color.RED, new Color(224, 200, 0), Color.BLACK, Color.WHITE, new Color(0, 192, 0), new Color(255, 165, 0), new Color(128, 0, 128), new Color(165, 42, 42), new Color(128, 128, 128)};
24-
/* The name of the colors. */
25-
teamColorName = new String[] {"Blue", "Red", "Yellow", "Black", "White", "Green", "Orange", "Purple", "Brown", "Gray"};
26-
/* If the clock may stop in certain states (Ready, Set) in a play-off game. */
27-
playOffTimeStop = true;
2822
/* Time in seconds one half is long. */
2923
halfTime = 10*60;
30-
/* Time in seconds the ready state is long. */
31-
readyTime = 45;
32-
/* Time in seconds between first and second half. */
33-
pauseTime = 10*60;
34-
/* If left and right side may both have the first kickoff. */
35-
kickoffChoice = false;
36-
/* Time in seconds the ball is blocked after kickoff. */
37-
kickoffTime = 10;
38-
/* Time in seconds the ball is blocked after a free kick. */
39-
freeKickTime = 30;
40-
/* Time in seconds the ready state during a penalty kick is long. */
41-
penaltyKickReadyTime = 30;
42-
/* Time in seconds before a global game stuck can be called. */
43-
minDurationBeforeStuck = 30;
44-
/* The number of seconds switching to Playing is delayed. */
45-
delayedSwitchToPlaying = 15;
46-
/* The number of seconds switching to Ready after a goal is delayed. */
47-
delayedSwitchAfterGoal = 15;
48-
/* If there is an overtime before penalty-shoot in a play-off game. */
49-
overtime = false;
50-
/* Time in seconds one overtime half is long. */
51-
overtimeTime = 0;
52-
/* If the game starts with penalty-shoots. */
53-
startWithPenalty = false;
54-
/* Time in seconds between second half and penalty shoot. */
55-
pausePenaltyShootOutTime = 0;
56-
/* Time in seconds one penalty shoot is long. */
57-
penaltyShotTime = 30;
58-
/* If there can be a penalty-shoot retry. */
59-
penaltyShotRetries = false;
60-
/* If there is a sudden-death. */
61-
suddenDeath = true;
62-
/* Time in seconds one penalty shoot is long in sudden-death. */
63-
penaltyShotTimeSuddenDeath = 30;
64-
/* Number of penalty-shots for each team. */
65-
numberOfPenaltyShots = 3;
66-
/* Time in seconds for each kind of penalty (-1 = should not be used). */
67-
penaltyTime = new int[] {-1, 45, 45, 15, 45, 45, 45, 45, 45, 15};
68-
/* Time in seconds to increment penalties. */
69-
penaltyIncreaseTime = 10;
70-
/* Whether the penalty count is reset on halftime */
71-
resetPenaltyCountOnHalftime = false;
72-
/* Whether penalties can be removed before the penalty time has passed. */
73-
allowEarlyPenaltyRemoval = false;
74-
/* Penalty that players get when they substitute another player. */
75-
substitutePenalty = PlayerInfo.PENALTY_SPL_REQUEST_FOR_PICKUP;
76-
/* if robots should return from penalties when the game state changes. */
77-
returnRobotsInGameStoppages = true;
78-
/* Time in seconds one team has as timeOut. */
79-
timeOutTime = 5*60;
80-
/* Time in seconds of a referee timeout */
81-
refereeTimeout = 10*60;
82-
/* Defines if the option for a referee timeout is available */
83-
isRefereeTimeoutAvailable = true;
84-
/* One time-out per half? */
85-
timeOutPerHalf = false;
86-
/* Allowed to compensate the lost time? */
87-
lostTime = true;
88-
/* If true, the game controller should drop broadcast-messages */
89-
dropBroadcastMessages = true;
90-
/* The type of the competition (COMPETITION_TYPE_NORMAL, COMPETITION_TYPE_CHALLENGE_SHIELD, etc) */
91-
competitionType = GameControlData.COMPETITION_TYPE_NORMAL;
92-
/* Number of hardware penalties per half before the robot is ejected. */
93-
allowedHardwarePenaltiesPerHalf = Integer.MAX_VALUE;
94-
/* Number of hardware penalties per game before the robot is ejected. */
95-
allowedHardwarePenaltiesPerGame = Integer.MAX_VALUE;
96-
/* Number of team messages a team is allowed to send per game. */
97-
overallMessageBudget = 1200;
98-
/* Number of team messages that are added to the budget per minute of extra time. */
99-
additionalMessageBudgetPerMinute = 60;
10024
}
10125
}

src/data/SPLPenaltyShootout.java

-17
This file was deleted.

src/teamcomm/data/GameState.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ public void gameControlDataChanged(final GameControlDataEvent e) {
229229
} else {
230230
logfileName.append(getTeamName((int) e.data.team[1].teamNumber, false, false)).append("_").append(getTeamName((int) e.data.team[0].teamNumber, false, false));
231231
}
232-
if (!Rules.league.startWithPenalty) {
232+
if (e.data.gamePhase != GameControlData.GAME_PHASE_PENALTYSHOOT) {
233233
logfileName.append(e.data.firstHalf == GameControlData.C_TRUE ? "_1st" : "_2nd").append("Half");
234234
}
235235
if (e.data.gameState == GameControlData.STATE_READY && (lastGameControlData == null || lastGameControlData.gameState == GameControlData.STATE_INITIAL)) {

0 commit comments

Comments
 (0)