-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi.txt
More file actions
652 lines (603 loc) · 38.6 KB
/
api.txt
File metadata and controls
652 lines (603 loc) · 38.6 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
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
A
A - Enum constant in enum class battlecode.common.Team
Team A.
actionCooldown - Variable in enum class battlecode.common.TrapType
actionCooldown - Variable in enum class battlecode.common.UnitType
add(Direction) - Method in class battlecode.common.MapLocation
Returns a new MapLocation object representing a location one unit in distance from this one in the given direction.
adjacentLocation(Direction) - Method in interface battlecode.common.RobotController
Returns the location adjacent to current location in the given direction.
allDirections() - Static method in enum class battlecode.common.Direction
Returns a list of all directions.
attack(MapLocation) - Method in interface battlecode.common.RobotController
Performs a rat attack (aka bite) action, defaulting to a bite with no cheese for rats
attack(MapLocation, int) - Method in interface battlecode.common.RobotController
Performs the specific attack for this robot type, consuming the specified amount of cheese for increasing bite strength
ATTACK_DISTANCE_SQUARED - Static variable in class battlecode.common.GameConstants
The maximum distance squared a robot can attack
B
B - Enum constant in enum class battlecode.common.Team
Team B.
BABY_RAT - Enum constant in enum class battlecode.common.UnitType
battlecode.common - package battlecode.common
becomeRatKing() - Method in interface battlecode.common.RobotController
Upgrades this rat into a rat king if possible, when 7 allied rats are in the 3x3 square centered at this rat's location and the ally team has 50 cheese.
bottomLeftDistanceSquaredTo(MapLocation) - Method in class battlecode.common.MapLocation
Computes the squared distance from the multi-part robot at this location (centered at this location) to the specified location.
BUILD_DISTANCE_SQUARED - Static variable in class battlecode.common.GameConstants
The maximum distance from a robot for building traps or dirt
BUILD_ROBOT_BASE_COST - Static variable in class battlecode.common.GameConstants
The base cheese cost for spawning a rat
BUILD_ROBOT_COOLDOWN - Static variable in class battlecode.common.GameConstants
The amount added to the action cooldown counter after a king builds a robot
BUILD_ROBOT_COST_INCREASE - Static variable in class battlecode.common.GameConstants
The amount by which the cost to spawn a rat increases by for every NUM_ROBOTS_FOR_COST_INCREASE allied rats
BUILD_ROBOT_RADIUS_SQUARED - Static variable in class battlecode.common.GameConstants
The maximum distance from a rat king for building robots from the king's center.
buildCost - Variable in enum class battlecode.common.TrapType
Crumbs cost of each trap
buildRat(MapLocation) - Method in interface battlecode.common.RobotController
Spawns a baby rat at the given location.
bytecodeLimit - Variable in enum class battlecode.common.UnitType
C
canAttack(MapLocation) - Method in interface battlecode.common.RobotController
Tests whether this robot can attack (aka bite) the given location.
canAttack(MapLocation, int) - Method in interface battlecode.common.RobotController
Tests whether this robot can attack (bite) the given location with the given amount of cheese.
canBecomeRatKing() - Method in interface battlecode.common.RobotController
Checks if a rat can become a rat king, when 7 allied rats are in the 3x3 square centered at this rat's location and the ally team has 50 cheese.
canBuildRat(MapLocation) - Method in interface battlecode.common.RobotController
Checks if a rat king can spawn a baby rat at the given location.
canCarryRat(MapLocation) - Method in interface battlecode.common.RobotController
Tests whether the robot can grab (carry) a robot at the specified location.
canDropRat(Direction) - Method in interface battlecode.common.RobotController
Tests whether this robot can safely drop a carried robot in the specified direction.
canMove(Direction) - Method in interface battlecode.common.RobotController
Checks whether this robot can move one step in the target direction.
canMoveForward() - Method in interface battlecode.common.RobotController
Checks whether this robot can move one step in the direction it is facing.
canPickUpCheese(MapLocation) - Method in interface battlecode.common.RobotController
Tests whether this robot can pick up cheese at the given location.
canPlaceCatTrap(MapLocation) - Method in interface battlecode.common.RobotController
Tests whether this robot can place a cat trap at the given location.
canPlaceDirt(MapLocation) - Method in interface battlecode.common.RobotController
Tests whether this robot can place dirt at the given location.
canPlaceRatTrap(MapLocation) - Method in interface battlecode.common.RobotController
Tests whether this robot can place a rat trap at the given location.
canRemoveCatTrap(MapLocation) - Method in interface battlecode.common.RobotController
Tests whether this robot can remove a cat trap at the given location.
canRemoveDirt(MapLocation) - Method in interface battlecode.common.RobotController
Tests whether this robot can remove dirt from the given location.
canRemoveRatTrap(MapLocation) - Method in interface battlecode.common.RobotController
Tests whether this robot can remove a rat trap at the given location.
canSenseLocation(MapLocation) - Method in interface battlecode.common.RobotController
Checks whether the given location is within the robot's vision range, and if it is on the map.
canSenseRobot(int) - Method in interface battlecode.common.RobotController
Tests whether the given robot exists and if it is within this robot's vision range.
canSenseRobotAtLocation(MapLocation) - Method in interface battlecode.common.RobotController
Checks whether a robot is at a given location.
CANT_DO_THAT - Enum constant in enum class battlecode.common.GameActionExceptionType
Indicates when a robot tries to perform an action it can't.
CANT_MOVE_THERE - Enum constant in enum class battlecode.common.GameActionExceptionType
Indicates when a robot tries to move into a non-empty location.
CANT_SENSE_THAT - Enum constant in enum class battlecode.common.GameActionExceptionType
Indicates when a robot tries to sense a robot that no longer exists or is no longer in this robot's vision range.
canThrowRat() - Method in interface battlecode.common.RobotController
Tests whether the robot can throw a carried robot
canTransferCheese(MapLocation, int) - Method in interface battlecode.common.RobotController
Tests whether you can transfer cheese to a given rat king.
canTurn() - Method in interface battlecode.common.RobotController
Checks whether this robot can turn.
canTurn(Direction) - Method in interface battlecode.common.RobotController
Checks whether this robot can turn to the specified direction.
cardinalDirections() - Static method in enum class battlecode.common.Direction
Returns a list of all cardinal directions.
CARRY_COOLDOWN_MULTIPLIER - Static variable in class battlecode.common.GameConstants
The multiplier to the cooldowns when carrying another robot
carryingRobot - Variable in class battlecode.common.RobotInfo
The current robot being carried by this robot, or null if not carrying any robots.
carryRat(MapLocation) - Method in interface battlecode.common.RobotController
Causes this robot to pick up (grab) a robot at the specified location.
CAT - Enum constant in enum class battlecode.common.UnitType
CAT_DIG_ADDITIONAL_COOLDOWN - Static variable in class battlecode.common.GameConstants
CAT_POUNCE_MAX_DISTANCE_SQUARED - Static variable in class battlecode.common.GameConstants
The distance squared a cat can pounce to
CAT_SCRATCH_DAMAGE - Static variable in class battlecode.common.GameConstants
The damage a robot takes after being scratched by a cat
CAT_SLEEP_TIME - Static variable in class battlecode.common.GameConstants
Amount of rounds a cat sleeps for when fed
CAT_TRAP - Enum constant in enum class battlecode.common.TrapType
Traps the cat
CENTER - Enum constant in enum class battlecode.common.Direction
Direction that represents pointing nowhere.
CHEESE_COOLDOWN_PENALTY - Static variable in class battlecode.common.GameConstants
The fractional slowdown a rat's movement and actions (not turning!) incur per unit of cheese the rat is currently carrying.
CHEESE_MINE_SPAWN_PROBABILITY - Static variable in class battlecode.common.GameConstants
Probability parameter for cheese spawn at a mine.
CHEESE_PICK_UP_RADIUS_SQUARED - Static variable in class battlecode.common.GameConstants
The maximum distance for picking up cheese on the map.
CHEESE_SPAWN_AMOUNT - Static variable in class battlecode.common.GameConstants
How much cheese each mine spawns at once
CHEESE_TRANSFER_COOLDOWN - Static variable in class battlecode.common.GameConstants
The amount added to the action cooldown counter after dropping/transferring cheese
CHEESE_TRANSFER_RADIUS_SQUARED - Static variable in class battlecode.common.GameConstants
The maximum distance for transferring cheese to an allied rat king
cheeseAmount - Variable in class battlecode.common.RobotInfo
The current cheese this robot holds
chirality - Variable in class battlecode.common.RobotInfo
Robot chirality (used by cat only).
Clock - Class in battlecode.common
Clock is a singleton that allows contestants to introspect the state of their running code.
COMM_ARRAY_MAX_VALUE - Static variable in class battlecode.common.GameConstants
The maximum value of an integer in the shared array and persistent array.
compareTo(MapLocation) - Method in class battlecode.common.MapLocation
A comparison function for MapLocations.
COOLDOWN_LIMIT - Static variable in class battlecode.common.GameConstants
If the amount of cooldown is at least this value, a robot cannot act.
COOLDOWNS_PER_TURN - Static variable in class battlecode.common.GameConstants
The number of cooldown turns reduced per turn.
copy() - Method in class battlecode.common.Message
D
damage - Variable in enum class battlecode.common.TrapType
The damage done if trap triggered by opponent triggering the trap
DIG_COOLDOWN - Static variable in class battlecode.common.GameConstants
The amount added to the action cooldown counter after digging out a tile of dirt
DIG_DIRT_CHEESE_COST - Static variable in class battlecode.common.GameConstants
The cheese cost to dig up a tile of dirt
direction - Variable in class battlecode.common.RobotInfo
The current location of the robot.
Direction - Enum Class in battlecode.common
This enumeration represents a direction from one MapLocation to another.
DIRECTION_ORDER - Static variable in enum class battlecode.common.Direction
directionTo(MapLocation) - Method in class battlecode.common.MapLocation
Returns the closest approximate Direction from this MapLocation to location.
disintegrate() - Method in interface battlecode.common.RobotController
Destroys the robot.
distanceSquaredTo(MapLocation) - Method in class battlecode.common.MapLocation
Computes the squared distance from this location to the specified location.
dropRat(Direction) - Method in interface battlecode.common.RobotController
Safely drops robot in the specified direction
dx - Variable in enum class battlecode.common.Direction
Change in x.
dy - Variable in enum class battlecode.common.Direction
Change in y.
E
EAST - Enum constant in enum class battlecode.common.Direction
Direction that represents pointing east (right on screen).
equals(Object) - Method in class battlecode.common.MapLocation
Two MapLocations are regarded as equal iff their coordinates are the same.
equals(Object) - Method in class battlecode.common.RobotInfo
EXCEPTION_BYTECODE_PENALTY - Static variable in class battlecode.common.GameConstants
The bytecode penalty that is imposed each time an exception is thrown.
F
fromDelta(int, int) - Static method in enum class battlecode.common.Direction
Converts dx and dy to a Direction.
G
GAME_DEFAULT_SEED - Static variable in class battlecode.common.GameConstants
The default game seed.
GAME_MAX_NUMBER_OF_ROUNDS - Static variable in class battlecode.common.GameConstants
The maximum number of rounds in a game.
GameActionException - Exception Class in battlecode.common
An exception caused by a robot's interaction with the game world.
GameActionException(GameActionExceptionType, String) - Constructor for exception class battlecode.common.GameActionException
Creates a GameActionException with the given type and message.
GameActionException(GameActionExceptionType, String, Throwable) - Constructor for exception class battlecode.common.GameActionException
Creates a GameActionException with the given type and message.
GameActionExceptionType - Enum Class in battlecode.common
Enumerates the possible errors in GameWorld interactions that cause a GameActionException to be thrown.
GameConstants - Class in battlecode.common
GameConstants defines constants that affect gameplay.
GameConstants() - Constructor for class battlecode.common.GameConstants
getActionCooldown() - Method in enum class battlecode.common.UnitType
getActionCooldownTurns() - Method in interface battlecode.common.RobotController
Returns the number of action cooldown turns remaining before this unit can act again.
getAllCheese() - Method in interface battlecode.common.RobotController
Returns the amount of cheese the robot has access to.
getAllLocationsWithinRadiusSquared(MapLocation, int) - Method in interface battlecode.common.RobotController
Returns a list of all locations within the given vision cone of a location.
getAllPartLocations() - Method in interface battlecode.common.RobotController
Returns all the locations that a robot occupies E.g.
getAllTypeLocations(MapLocation) - Method in enum class battlecode.common.UnitType
getBytecodeLimit() - Method in enum class battlecode.common.UnitType
getBytecodeNum() - Static method in class battlecode.common.Clock
Returns the number of bytecodes the current robot has executed since the beginning of the current round.
getBytecodesLeft() - Static method in class battlecode.common.Clock
Returns the number of bytecodes this robot has left in this round.
getBytes() - Method in class battlecode.common.Message
getCarrying() - Method in interface battlecode.common.RobotController
Returns robot that this robot is carrying or null if this robot is not carrying another robot.
getCarryingRobot() - Method in class battlecode.common.RobotInfo
Returns the robot this robot is carrying, or null if not carrying a robot.
getCheeseAmount() - Method in class battlecode.common.MapInfo
Returns the amount of cheese on this square (guaranteed to be 0 if no rats died here and not near a cheese mine).
getChirality() - Method in class battlecode.common.RobotInfo
Returns the chirality of this robot.
getCurrentRatCost() - Method in interface battlecode.common.RobotController
Returns the current cheese cost for an allied rat king to spawn a rat.
getDeltaX() - Method in enum class battlecode.common.Direction
Returns the delta X of the direction.
getDeltaY() - Method in enum class battlecode.common.Direction
Returns the delta Y of the direction.
getDirection() - Method in interface battlecode.common.RobotController
Returns this robot's current direction.
getDirection() - Method in class battlecode.common.RobotInfo
Returns the direction of this robot.
getDirectionOrderNum() - Method in enum class battlecode.common.Direction
getDirt() - Method in interface battlecode.common.RobotController
Returns the amount of dirt that this robot's team has.
getGlobalCheese() - Method in interface battlecode.common.RobotController
Returns the amount of global cheese available.
getHealth() - Method in interface battlecode.common.RobotController
Returns this robot's current health.
getHealth() - Method in class battlecode.common.RobotInfo
Returns the health of this robot.
getHealth() - Method in enum class battlecode.common.UnitType
getID() - Method in interface battlecode.common.RobotController
Returns the ID of this robot.
getID() - Method in class battlecode.common.RobotInfo
Returns the ID of this robot.
getLocation() - Method in interface battlecode.common.RobotController
Returns this robot's designated center location.
getLocation() - Method in class battlecode.common.RobotInfo
Returns the location of this robot.
getMapHeight() - Method in interface battlecode.common.RobotController
Returns the height of the game map.
getMapLocation() - Method in class battlecode.common.MapInfo
Returns the location of this square
getMapWidth() - Method in interface battlecode.common.RobotController
Returns the width of the game map.
getMovementCooldown() - Method in enum class battlecode.common.UnitType
getMovementCooldownTurns() - Method in interface battlecode.common.RobotController
Returns the number of movement cooldown turns remaining before this unit can move again.
getRawCheese() - Method in interface battlecode.common.RobotController
Returns the amount of cheese the robot is currently holding.
getRawCheeseAmount() - Method in class battlecode.common.RobotInfo
Returns the cheese amount of this robot.
getRound() - Method in class battlecode.common.Message
getRoundNum() - Method in interface battlecode.common.RobotController
Returns the current round number, where round 1 is the first round of the match.
getSenderID() - Method in class battlecode.common.Message
getSize() - Method in enum class battlecode.common.UnitType
getSource() - Method in class battlecode.common.Message
getTeam() - Method in interface battlecode.common.RobotController
Returns this robot's Team.
getTeam() - Method in class battlecode.common.RobotInfo
Returns the team that this robot is on.
getTimeElapsed() - Static method in class battlecode.common.Clock
Returns the total amount of time that this team's robots have collectively spent executing since the beginning of the match.
getTimeLeft() - Static method in class battlecode.common.Clock
Returns the total amount of execution time left this team has before they timeout
getTrap() - Method in class battlecode.common.MapInfo
Returns the trap on this square, or TrapType.NONE if there is no trap.
getTurningCooldownTurns() - Method in interface battlecode.common.RobotController
Returns the number of turning cooldown turns remaining before this unit can turn again.
getType() - Method in exception class battlecode.common.GameActionException
Gives the type of gameworld interaction that caused this GameActionException, which was specified when this instance was constructed.
getType() - Method in interface battlecode.common.RobotController
Returns what UnitType this robot is.
getType() - Method in class battlecode.common.RobotInfo
Returns this robot's type.
getVisionAngle() - Method in enum class battlecode.common.UnitType
getVisionRadiusSquared() - Method in enum class battlecode.common.UnitType
H
hasCheeseMine() - Method in class battlecode.common.MapInfo
Returns if this square has a cheese mine.
hashCode() - Method in class battlecode.common.MapLocation
hashCode() - Method in class battlecode.common.RobotInfo
health - Variable in class battlecode.common.RobotInfo
The health of the robot.
health - Variable in enum class battlecode.common.UnitType
HEALTH_GRAB_THRESHOLD - Static variable in class battlecode.common.GameConstants
The minimum gap between an enemy robot's health and our own before we can grab it from all angles
HIT_GROUND_COOLDOWN - Static variable in class battlecode.common.GameConstants
The stun cooldown after hitting the ground after being thrown
HIT_TARGET_COOLDOWN - Static variable in class battlecode.common.GameConstants
The stun cooldown after hitting the target after being thrown
I
ID - Variable in class battlecode.common.RobotInfo
The unique ID of the robot.
INDICATOR_STRING_MAX_LENGTH - Static variable in class battlecode.common.GameConstants
The maximum length of indicator strings that a player can associate with a robot.
INITIAL_TEAM_CHEESE - Static variable in class battlecode.common.GameConstants
The amount of cheese each team starts with.
INTERNAL_ERROR - Enum constant in enum class battlecode.common.GameActionExceptionType
Internal error in the GameWorld engine.
IS_NOT_READY - Enum constant in enum class battlecode.common.GameActionExceptionType
Indicates when a robot tries to execute an action, but is not currently idle.
isActionReady() - Method in interface battlecode.common.RobotController
Tests whether the robot can act.
isAdjacentTo(MapLocation) - Method in class battlecode.common.MapLocation
Determines whether this location is adjacent to a given location.
isBabyRatType() - Method in enum class battlecode.common.UnitType
isBeingCarried() - Method in interface battlecode.common.RobotController
Returns whether robot is being carried.
isBeingThrown() - Method in interface battlecode.common.RobotController
Returns whether robot is being thrown.
isCatType() - Method in enum class battlecode.common.UnitType
isCooperation() - Method in interface battlecode.common.RobotController
Returns the game state- true if in cooperation mode, false if in backstabbing mode.
isDirt() - Method in class battlecode.common.MapInfo
Returns if this square is a dirt.
isLocationOccupied(MapLocation) - Method in interface battlecode.common.RobotController
Checks whether a robot is at a given location.
isMovementReady() - Method in interface battlecode.common.RobotController
Tests whether the robot can move.
isPassable() - Method in class battlecode.common.MapInfo
Returns if this square is passable.
isPlayer() - Method in enum class battlecode.common.Team
Returns whether a robot of this team is a player-controlled entity (team A or team B).
isRatKingType() - Method in enum class battlecode.common.UnitType
isRobotType() - Method in enum class battlecode.common.UnitType
isThrowableType() - Method in enum class battlecode.common.UnitType
isThrowingType() - Method in enum class battlecode.common.UnitType
isTurningReady() - Method in interface battlecode.common.RobotController
Tests whether the robot can turn.
isWall() - Method in class battlecode.common.MapInfo
Returns if this square is a wall.
isWithinDistanceSquared(MapLocation, int) - Method in class battlecode.common.MapLocation
Determines whether this location is within a specified distance from target location.
isWithinDistanceSquared(MapLocation, int, Direction, double) - Method in class battlecode.common.MapLocation
Determines whether this location is within a specified distance and cone degree from target location.
isWithinDistanceSquared(MapLocation, int, Direction, double, boolean) - Method in class battlecode.common.MapLocation
Determines whether this location is within a specified distance and cone degree from target location.
L
location - Variable in class battlecode.common.RobotInfo
The current location of the robot.
M
MAP_MAX_HEIGHT - Static variable in class battlecode.common.GameConstants
The maximum possible map height.
MAP_MAX_WIDTH - Static variable in class battlecode.common.GameConstants
The maximum possible map width.
MAP_MIN_HEIGHT - Static variable in class battlecode.common.GameConstants
The minimum possible map height.
MAP_MIN_WIDTH - Static variable in class battlecode.common.GameConstants
The minimum possible map width.
MapInfo - Class in battlecode.common
MapInfo(MapLocation, boolean, boolean, boolean, int, TrapType, boolean) - Constructor for class battlecode.common.MapInfo
MapLocation - Class in battlecode.common
This class is an immutable representation of two-dimensional coordinates in the battlecode world.
MapLocation(int, int) - Constructor for class battlecode.common.MapLocation
Creates a new MapLocation representing the location with the given coordinates.
MAX_CARRY_DURATION - Static variable in class battlecode.common.GameConstants
The maximum number of turns of robots a rat can carry another rat
MAX_CARRY_TOWER_HEIGHT - Static variable in class battlecode.common.GameConstants
The maximum number of robots a rat can carry
MAX_DIRT_PERCENTAGE - Static variable in class battlecode.common.GameConstants
The maximum percentage of the map that can be dirt
MAX_MESSAGES_SENT_ROBOT - Static variable in class battlecode.common.GameConstants
The maximum number of messages a robot can send per turn
MAX_NUMBER_OF_RAT_KINGS - Static variable in class battlecode.common.GameConstants
The maximum number of rat kings that a team can have.
MAX_NUMBER_OF_RAT_KINGS_AFTER_CUTOFF - Static variable in class battlecode.common.GameConstants
The maximum number of rat kings that a team can have after the cutoff round.
MAX_TEAM_EXECUTION_TIME - Static variable in class battlecode.common.GameConstants
The maximum execution time that can be spent on a team in one match.
MAX_WALL_PERCENTAGE - Static variable in class battlecode.common.GameConstants
The maximum percentage of the map that can be walls
maxCount - Variable in enum class battlecode.common.TrapType
Maximum number of this trap type that a team can have active at once
Message - Class in battlecode.common
Message(int, int, int, MapLocation) - Constructor for class battlecode.common.Message
MESSAGE_ROUND_DURATION - Static variable in class battlecode.common.GameConstants
The maximum number of rounds a message will exist for
MIN_CHEESE_MINE_SPACING_SQUARED - Static variable in class battlecode.common.GameConstants
The minimum distance between cheese mines on the map
move(Direction) - Method in interface battlecode.common.RobotController
Moves one step in the specified direction.
MOVE_STRAFE_COOLDOWN - Static variable in class battlecode.common.GameConstants
The default cooldown applied when moving in one of the 7 non-forward directions (forward is 10 ticks)
moveForward() - Method in interface battlecode.common.RobotController
Moves one step in the direction the robot is facing.
movementCooldown - Variable in enum class battlecode.common.UnitType
N
NEUTRAL - Enum constant in enum class battlecode.common.Team
Neutral robots.
NO_ROBOT_THERE - Enum constant in enum class battlecode.common.GameActionExceptionType
Indicates when a robot tries to perform an action on another robot, but there is no suitable robot there.
NONE - Enum constant in enum class battlecode.common.TrapType
No trap
NORTH - Enum constant in enum class battlecode.common.Direction
Direction that represents pointing north (up on screen).
NORTHEAST - Enum constant in enum class battlecode.common.Direction
Direction that represents pointing northeast (up and to the right on screen).
NORTHWEST - Enum constant in enum class battlecode.common.Direction
Direction that represents pointing northwest (up and to the left on screen).
NOT_ENOUGH_RESOURCE - Enum constant in enum class battlecode.common.GameActionExceptionType
Indicates when a robot tries to perform an action for which it does not have enough resources.
NUM_ROBOTS_FOR_COST_INCREASE - Static variable in class battlecode.common.GameConstants
The number of allied rats needed to increase the base cost of a rat by BUILD_ROBOT_COST_INCREASE
NUMBER_INITIAL_RAT_KINGS - Static variable in class battlecode.common.GameConstants
The number of rat kings a player starts with.
O
onTheMap(MapLocation) - Method in interface battlecode.common.RobotController
Checks whether a MapLocation is on the map.
opponent() - Method in enum class battlecode.common.Team
Determines the team that is the opponent of this team.
opposite() - Method in enum class battlecode.common.Direction
Computes the direction opposite this one.
OUT_OF_RANGE - Enum constant in enum class battlecode.common.GameActionExceptionType
Indicates when a robot tries to perform an action on a location that is outside its range.
P
pickUpCheese(MapLocation) - Method in interface battlecode.common.RobotController
picks up cheese from the given location.
PLACE_DIRT_CHEESE_COST - Static variable in class battlecode.common.GameConstants
The cheese cost to place a tile of dirt
placeCatTrap(MapLocation) - Method in interface battlecode.common.RobotController
Places a cat trap at the given location.
placeDirt(MapLocation) - Method in interface battlecode.common.RobotController
Places dirt at the given location.
placeRatTrap(MapLocation) - Method in interface battlecode.common.RobotController
Places a rat trap at the given location.
R
RAT_BITE_DAMAGE - Static variable in class battlecode.common.GameConstants
The damage a robot takes after being bitten by a rat
RAT_KING - Enum constant in enum class battlecode.common.UnitType
RAT_KING_ATTACK_DISTANCE_SQUARED - Static variable in class battlecode.common.GameConstants
The maximum distance squared a rat king can attack, measured from the king's center.
RAT_KING_BUILD_DISTANCE_SQUARED - Static variable in class battlecode.common.GameConstants
The maximum distance squared a rat king can build traps or dirt, measured from the king's center.
RAT_KING_CHEESE_CONSUMPTION - Static variable in class battlecode.common.GameConstants
The amount of cheese the rat king consumes each round.
RAT_KING_CUTOFF_ROUND - Static variable in class battlecode.common.GameConstants
The round after which the maximum number of rat kings is reduced.
RAT_KING_HEALTH_LOSS - Static variable in class battlecode.common.GameConstants
The amount of health the rat king loses by not eating cheese.
RAT_KING_UPGRADE_CHEESE_COST - Static variable in class battlecode.common.GameConstants
The cheese cost for upgrading a rat into a rat king
RAT_TRAP - Enum constant in enum class battlecode.common.TrapType
Traps enemy rats
readSharedArray(int) - Method in interface battlecode.common.RobotController
Reads a value from the shared array at the given index.
readSqueaks(int) - Method in interface battlecode.common.RobotController
Reads all squeaks sent to this unit within the past 5 rounds if roundNum = -1, or only squeaks sent from the specified round otherwise
removeCatTrap(MapLocation) - Method in interface battlecode.common.RobotController
Removes the cat trap at the given location.
removeDirt(MapLocation) - Method in interface battlecode.common.RobotController
Removes dirt from the given location.
removeRatTrap(MapLocation) - Method in interface battlecode.common.RobotController
Removes the rat trap at the given location.
resign() - Method in interface battlecode.common.RobotController
Causes your team to lose the game.
RobotController - Interface in battlecode.common
A RobotController allows contestants to make their robot sense and interact with the game world.
RobotInfo - Class in battlecode.common
RobotInfo stores basic information that was 'sensed' of another Robot.
RobotInfo(int, Team, UnitType, int, MapLocation, Direction, int, int, RobotInfo) - Constructor for class battlecode.common.RobotInfo
rotateLeft() - Method in enum class battlecode.common.Direction
Computes the direction 45 degrees to the left (counter-clockwise) of this one.
rotateRight() - Method in enum class battlecode.common.Direction
Computes the direction 45 degrees to the right (clockwise) of this one.
ROUND_OUT_OF_RANGE - Enum constant in enum class battlecode.common.GameActionExceptionType
Indicates when round number is out of range.
S
SAME_ROBOT_CARRY_COOLDOWN_TURNS - Static variable in class battlecode.common.GameConstants
The minimum number of turns after a robot hits the ground or is dropped before it can be grabbed again by its most recent grabber.
senseMapInfo(MapLocation) - Method in interface battlecode.common.RobotController
Senses the map info at a location.
senseNearbyMapInfos() - Method in interface battlecode.common.RobotController
Return map info for all senseable locations.
senseNearbyMapInfos(int) - Method in interface battlecode.common.RobotController
Return map info for all senseable locations within a radius squared.
senseNearbyMapInfos(MapLocation) - Method in interface battlecode.common.RobotController
Return map info for all senseable locations within vision radius of a center location.
senseNearbyMapInfos(MapLocation, int) - Method in interface battlecode.common.RobotController
Return map info for all senseable locations within a radius squared of a center location.
senseNearbyRobots() - Method in interface battlecode.common.RobotController
Returns all robots within vision radius.
senseNearbyRobots(int) - Method in interface battlecode.common.RobotController
Returns all robots that can be sensed within a certain distance of this robot.
senseNearbyRobots(int, Team) - Method in interface battlecode.common.RobotController
Returns all robots of a given team that can be sensed within a certain distance of this robot.
senseNearbyRobots(MapLocation, int, Team) - Method in interface battlecode.common.RobotController
Returns all robots of a given team that can be sensed within a certain radius of a specified location.
sensePassability(MapLocation) - Method in interface battlecode.common.RobotController
Given a senseable location, returns whether that location is passable (i.e.
senseRobot(int) - Method in interface battlecode.common.RobotController
Senses information about a particular robot given its ID.
senseRobotAtLocation(MapLocation) - Method in interface battlecode.common.RobotController
Senses the robot at the given location, or null if there is no robot there.
setIndicatorDot(MapLocation, int, int, int) - Method in interface battlecode.common.RobotController
Draw a dot on the game map for debugging purposes.
setIndicatorLine(MapLocation, MapLocation, int, int, int) - Method in interface battlecode.common.RobotController
Draw a line on the game map for debugging purposes.
setIndicatorString(String) - Method in interface battlecode.common.RobotController
Sets the indicator string for this robot for debugging purposes.
setTimelineMarker(String, int, int, int) - Method in interface battlecode.common.RobotController
Adds a marker to the timeline at the current round for debugging purposes.
SHARED_ARRAY_SIZE - Static variable in class battlecode.common.GameConstants
The size of the shared array.
size - Variable in enum class battlecode.common.UnitType
SOUTH - Enum constant in enum class battlecode.common.Direction
Direction that represents pointing south (down on screen).
SOUTHEAST - Enum constant in enum class battlecode.common.Direction
Direction that represents pointing southeast (down and to the right on screen).
SOUTHWEST - Enum constant in enum class battlecode.common.Direction
Direction that represents pointing southwest (down and to the left on screen).
SPEC_VERSION - Static variable in class battlecode.common.GameConstants
The current spec version the server compiles with.
SQ_CHEESE_SPAWN_RADIUS - Static variable in class battlecode.common.GameConstants
Cheese will spawn within a [-radius, radius] square of the cheese mine
squeak(int) - Method in interface battlecode.common.RobotController
Sends a message (contained in an int, so 4 bytes) to all locations within squeaking range.
SQUEAK_RADIUS_SQUARED - Static variable in class battlecode.common.GameConstants
The maximum squared radius a robot can squeak to
stunTime - Variable in enum class battlecode.common.TrapType
How many turn stun lasts after entering
subtract(Direction) - Method in class battlecode.common.MapLocation
Returns a new MapLocation object representing a location one unit in distance from this one in the opposite direction of the given direction.
T
team - Variable in class battlecode.common.RobotInfo
The Team that the robot is on.
Team - Enum Class in battlecode.common
This enum represents the team of a robot.
THROW_DAMAGE - Static variable in class battlecode.common.GameConstants
The base damage a thrown rat takes upon hitting the ground
THROW_DAMAGE_PER_TILE - Static variable in class battlecode.common.GameConstants
The damage a thrown rat takes per tile it impacts early (i.e.
THROW_DURATION - Static variable in class battlecode.common.GameConstants
The total number turns a rat can travel for while thrown (rats are stunned while thrown)
THROW_RAT_COOLDOWN - Static variable in class battlecode.common.GameConstants
Incurred cooldown for throwing a rat
throwRat() - Method in interface battlecode.common.RobotController
Throws robot in the robot's facing direction
TILES_FLOWN_PER_TURN - Static variable in class battlecode.common.GameConstants
TIMELINE_LABEL_MAX_LENGTH - Static variable in class battlecode.common.GameConstants
The maximum length of a label to add to the timeline.
toString() - Method in class battlecode.common.MapInfo
toString() - Method in class battlecode.common.MapLocation
toString() - Method in class battlecode.common.Message
toString() - Method in class battlecode.common.RobotInfo
transferCheese(MapLocation, int) - Method in interface battlecode.common.RobotController
Transfers cheese to a given rat king.
translate(int, int) - Method in class battlecode.common.MapLocation
Returns a new MapLocation object translated from this location by a fixed amount.
TrapType - Enum Class in battlecode.common
Enumerates possible traps that can be built.
triggerRadiusSquared - Variable in enum class battlecode.common.TrapType
The radius within which the trap is triggered
turn(Direction) - Method in interface battlecode.common.RobotController
Turns to the specified direction
TURNING_COOLDOWN - Static variable in class battlecode.common.GameConstants
The amount added to the turning cooldown counter when turning
type - Variable in class battlecode.common.RobotInfo
The type of the robot.
U
UnitType - Enum Class in battlecode.common
usesBottomLeftLocationForDistance() - Method in enum class battlecode.common.UnitType
V
valueOf(String) - Static method in enum class battlecode.common.Direction
Returns the enum constant of this class with the specified name.
valueOf(String) - Static method in enum class battlecode.common.GameActionExceptionType
Returns the enum constant of this class with the specified name.
valueOf(String) - Static method in class battlecode.common.MapLocation
valueOf(String) - Static method in enum class battlecode.common.Team
Returns the enum constant of this class with the specified name.
valueOf(String) - Static method in enum class battlecode.common.TrapType
Returns the enum constant of this class with the specified name.
valueOf(String) - Static method in enum class battlecode.common.UnitType
Returns the enum constant of this class with the specified name.
values() - Static method in enum class battlecode.common.Direction
Returns an array containing the constants of this enum class, in the order they are declared.
values() - Static method in enum class battlecode.common.GameActionExceptionType
Returns an array containing the constants of this enum class, in the order they are declared.
values() - Static method in enum class battlecode.common.Team
Returns an array containing the constants of this enum class, in the order they are declared.
values() - Static method in enum class battlecode.common.TrapType
Returns an array containing the constants of this enum class, in the order they are declared.
values() - Static method in enum class battlecode.common.UnitType
Returns an array containing the constants of this enum class, in the order they are declared.
visionConeAngle - Variable in enum class battlecode.common.UnitType
visionConeRadiusSquared - Variable in enum class battlecode.common.UnitType
W
WEST - Enum constant in enum class battlecode.common.Direction
Direction that represents pointing west (left on screen).
writeSharedArray(int, int) - Method in interface battlecode.common.RobotController
Writes a value to the shared array at the given index.
X
x - Variable in class battlecode.common.MapLocation
The x-coordinate.
Y
y - Variable in class battlecode.common.MapLocation
The y-coordinate.
yield() - Static method in class battlecode.common.Clock
Ends the processing of this robot during the current round.