File tree Expand file tree Collapse file tree 2 files changed +2
-22
lines changed
engine/src/main/battlecode Expand file tree Collapse file tree 2 files changed +2
-22
lines changed Original file line number Diff line number Diff line change @@ -85,16 +85,8 @@ public class GameConstants {
8585 /** The percent of the map which a team needs to paint to win. */
8686 public static final int PAINT_PERCENT_TO_WIN = 70 ;
8787
88- /** The maximum number of towers that a team can have. */
89- public static final int MAX_NUMBER_OF_TOWERS = 25 ;
90-
91- /**
92- * The maximum execution time that can be spent on a team in one match. If the total time spent executing a team's bots
93- * exceeds this limit, the team will immediately lose the game. Execution time is measured in ns.
94- */
95- // public static final long MAX_TEAM_EXECUTION_TIME = 1200000000000L;
96-
97- public static final long MAX_TEAM_EXECUTION_TIME = 5000000000L ;
88+ /** The maximum number of towers that a team can have. */
89+ public static final int MAX_NUMBER_OF_TOWERS = 25 ;
9890
9991 // *********************************
10092 // ****** GAME MECHANICS ***********
Original file line number Diff line number Diff line change 11package battlecode .world .control ;
22
3- import battlecode .common .GameConstants ;
43import battlecode .common .Team ;
54import battlecode .instrumenter .InstrumentationException ;
65import battlecode .instrumenter .TeamClassLoaderFactory ;
@@ -71,11 +70,6 @@ public class PlayerControlProvider implements RobotControlProvider {
7170 */
7271 private int matchId = -1 ;
7372
74- /**
75- * The total time the player's bots have spent executing, measured in ns
76- */
77- private long totalPlayerTime = 0 ;
78-
7973 /**
8074 * Create a new PlayerControlProvider.
8175 *
@@ -122,7 +116,6 @@ public void matchEnded() {
122116
123117 this .sandboxes .clear ();
124118 this .gameWorld = null ;
125- this .totalPlayerTime = 0 ;
126119 }
127120
128121 @ Override
@@ -180,12 +173,7 @@ public void runRobot(InternalRobot robot) {
180173
181174 if (player != null ) {
182175 player .setBytecodeLimit (robot .getBytecodeLimit ());
183- long timeBefore = System .nanoTime ();
184176 player .step ();
185- totalPlayerTime += (System .nanoTime () - timeBefore );
186- if (totalPlayerTime > GameConstants .MAX_TEAM_EXECUTION_TIME ) {
187- robot .getController ().resign ();
188- }
189177 }
190178 }
191179
You can’t perform that action at this time.
0 commit comments