Skip to content

Commit

Permalink
Remove more unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
ahasselbring committed Apr 10, 2024
1 parent 4fbb4bd commit 0dbf45e
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 172 deletions.
79 changes: 1 addition & 78 deletions src/data/Rules.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ public abstract class Rules
{
/** Note all league's rules here to have them available. */
public static final Rules[] LEAGUES = {
new SPL(),
new SPLPenaltyShootout()
new SPL()
};

/**
Expand All @@ -36,84 +35,8 @@ public static Rules getLeagueRules(final Class<? extends Rules> c) {
public String leagueDirectory;
/** How many robots are in a team. */
public int teamSize;
/** How many robots of each team may play at one time. */
public int robotsPlaying;
/** The Java Colors the left and the right team starts with. */
public Color[] teamColor;
/** The name of the colors. */
public String[] teamColorName;
/** If the clock may stop in certain states (Ready, Set) in a play-off game. */
public boolean playOffTimeStop;
/** Time in seconds one half is long. */
public int halfTime;
/** Time in seconds the ready state is long. */
public int readyTime;
/** Time in seconds between first and second half. */
public int pauseTime;
/** If left and right side may both have the first kickoff. */
public boolean kickoffChoice;
/** Time in seconds the ball is blocked after kickoff. */
public int kickoffTime;
/** Time in seconds the ball is blocked after a free kick. */
public int freeKickTime;
/** Time in seconds the the ready state during a penalty kick is long. */
public int penaltyKickReadyTime;
/** Time in seconds before a global game stuck can be called. */
public int minDurationBeforeStuck;
/** The number of seconds switching to Playing is delayed. */
public int delayedSwitchToPlaying;
/** The number of seconds switching to Ready after a goal is delayed. */
public int delayedSwitchAfterGoal;
/** If there is an overtime before the penalty shoot-out in a play-off game. */
public boolean overtime;
/** Time in seconds one overtime half is long. */
public int overtimeTime;
/** If the game starts with penalty-shots. */
public boolean startWithPenalty;
/** Time in seconds between second half and penalty shoot-out. */
public int pausePenaltyShootOutTime;
/** Time in seconds one penalty shoot is long. */
public int penaltyShotTime;
/** If there can be a penalty-shot retry. */
public boolean penaltyShotRetries;
/** If there is a sudden-death. */
public boolean suddenDeath;
/** Time in seconds one penalty shoot is long in sudden-death. */
public int penaltyShotTimeSuddenDeath;
/** Number of penalty-shots for each team. */
public int numberOfPenaltyShots;
/** Time in seconds for each kind of penalty. */
public int[] penaltyTime;
/** Time in seconds to increment penalties. */
public int penaltyIncreaseTime;
/** Whether the penalty count is reset on halftime */
public boolean resetPenaltyCountOnHalftime;
/** Whether penalties can be removed before the penalty time has passed. */
public boolean allowEarlyPenaltyRemoval;
/** Penalty that players get when they substitute another player. */
public byte substitutePenalty;
/** if robots should return from penalties when the game state changes. */
public boolean returnRobotsInGameStoppages;
/** Time in seconds one team has as timeOut. */
public int timeOutTime;
/** Time in seconds of a referee timeout. */
public int refereeTimeout;
/** Defines if the option for a referee timeout is available. */
public boolean isRefereeTimeoutAvailable;
/** One time-out per half? */
public boolean timeOutPerHalf;
/** Allowed to compensate for lost time? */
public boolean lostTime;
/** If true, the game controller should drop broadcast-messages */
public boolean dropBroadcastMessages;
/** The type of the competition (COMPETITION_TYPE_NORMAL, COMPETITION_TYPE_CHALLENGE_SHIELD, etc) */
public byte competitionType;
/** Number of hardware penalties per half before the robot is ejected. */
public int allowedHardwarePenaltiesPerHalf;
/** Number of hardware penalties per game before the robot is ejected. */
public int allowedHardwarePenaltiesPerGame;
/** Number of team messages a team is allowed to send per game. */
public short overallMessageBudget;
/** Number of team messages that are added to the budget per minute of extra time. */
public short additionalMessageBudgetPerMinute;
}
76 changes: 0 additions & 76 deletions src/data/SPL.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,85 +17,9 @@ public class SPL extends Rules
leagueDirectory = "spl";
/* How many robots are in a team. */
teamSize = 6; // 5 players + 1 sub
/* How many robots of each team may play at one time. */
robotsPlaying = 5;
/* The Java Colors the left and the right team starts with. */
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)};
/* The name of the colors. */
teamColorName = new String[] {"Blue", "Red", "Yellow", "Black", "White", "Green", "Orange", "Purple", "Brown", "Gray"};
/* If the clock may stop in certain states (Ready, Set) in a play-off game. */
playOffTimeStop = true;
/* Time in seconds one half is long. */
halfTime = 10*60;
/* Time in seconds the ready state is long. */
readyTime = 45;
/* Time in seconds between first and second half. */
pauseTime = 10*60;
/* If left and right side may both have the first kickoff. */
kickoffChoice = false;
/* Time in seconds the ball is blocked after kickoff. */
kickoffTime = 10;
/* Time in seconds the ball is blocked after a free kick. */
freeKickTime = 30;
/* Time in seconds the ready state during a penalty kick is long. */
penaltyKickReadyTime = 30;
/* Time in seconds before a global game stuck can be called. */
minDurationBeforeStuck = 30;
/* The number of seconds switching to Playing is delayed. */
delayedSwitchToPlaying = 15;
/* The number of seconds switching to Ready after a goal is delayed. */
delayedSwitchAfterGoal = 15;
/* If there is an overtime before penalty-shoot in a play-off game. */
overtime = false;
/* Time in seconds one overtime half is long. */
overtimeTime = 0;
/* If the game starts with penalty-shoots. */
startWithPenalty = false;
/* Time in seconds between second half and penalty shoot. */
pausePenaltyShootOutTime = 0;
/* Time in seconds one penalty shoot is long. */
penaltyShotTime = 30;
/* If there can be a penalty-shoot retry. */
penaltyShotRetries = false;
/* If there is a sudden-death. */
suddenDeath = true;
/* Time in seconds one penalty shoot is long in sudden-death. */
penaltyShotTimeSuddenDeath = 30;
/* Number of penalty-shots for each team. */
numberOfPenaltyShots = 3;
/* Time in seconds for each kind of penalty (-1 = should not be used). */
penaltyTime = new int[] {-1, 45, 45, 15, 45, 45, 45, 45, 45, 15};
/* Time in seconds to increment penalties. */
penaltyIncreaseTime = 10;
/* Whether the penalty count is reset on halftime */
resetPenaltyCountOnHalftime = false;
/* Whether penalties can be removed before the penalty time has passed. */
allowEarlyPenaltyRemoval = false;
/* Penalty that players get when they substitute another player. */
substitutePenalty = PlayerInfo.PENALTY_SPL_REQUEST_FOR_PICKUP;
/* if robots should return from penalties when the game state changes. */
returnRobotsInGameStoppages = true;
/* Time in seconds one team has as timeOut. */
timeOutTime = 5*60;
/* Time in seconds of a referee timeout */
refereeTimeout = 10*60;
/* Defines if the option for a referee timeout is available */
isRefereeTimeoutAvailable = true;
/* One time-out per half? */
timeOutPerHalf = false;
/* Allowed to compensate the lost time? */
lostTime = true;
/* If true, the game controller should drop broadcast-messages */
dropBroadcastMessages = true;
/* The type of the competition (COMPETITION_TYPE_NORMAL, COMPETITION_TYPE_CHALLENGE_SHIELD, etc) */
competitionType = GameControlData.COMPETITION_TYPE_NORMAL;
/* Number of hardware penalties per half before the robot is ejected. */
allowedHardwarePenaltiesPerHalf = Integer.MAX_VALUE;
/* Number of hardware penalties per game before the robot is ejected. */
allowedHardwarePenaltiesPerGame = Integer.MAX_VALUE;
/* Number of team messages a team is allowed to send per game. */
overallMessageBudget = 1200;
/* Number of team messages that are added to the budget per minute of extra time. */
additionalMessageBudgetPerMinute = 60;
}
}
17 changes: 0 additions & 17 deletions src/data/SPLPenaltyShootout.java

This file was deleted.

2 changes: 1 addition & 1 deletion src/teamcomm/data/GameState.java
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ public void gameControlDataChanged(final GameControlDataEvent e) {
} else {
logfileName.append(getTeamName((int) e.data.team[1].teamNumber, false, false)).append("_").append(getTeamName((int) e.data.team[0].teamNumber, false, false));
}
if (!Rules.league.startWithPenalty) {
if (e.data.gamePhase != GameControlData.GAME_PHASE_PENALTYSHOOT) {
logfileName.append(e.data.firstHalf == GameControlData.C_TRUE ? "_1st" : "_2nd").append("Half");
}
if (e.data.gameState == GameControlData.STATE_READY && (lastGameControlData == null || lastGameControlData.gameState == GameControlData.STATE_INITIAL)) {
Expand Down

0 comments on commit 0dbf45e

Please sign in to comment.