Skip to content

Commit e567d07

Browse files
authored
Merge pull request #316 from battlecode/update-javadoc
Update javadoc
2 parents 9c79d77 + ee589d8 commit e567d07

5 files changed

Lines changed: 86 additions & 85 deletions

File tree

src/main/battlecode/common/BulletInfo.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,22 +42,21 @@ public BulletInfo(int ID, MapLocation location, Direction dir, float speed, floa
4242
}
4343

4444
/**
45-
* The speed at which the bullet is traveling in
46-
* terms of units per turn
45+
* @return the speed at which the bullet is traveling in units per turn
4746
*/
4847
public float getSpeed() {
4948
return speed;
5049
}
5150

5251
/**
53-
* The damage this bullet deals on impact
52+
* @return the damage this bullet deals on impact
5453
*/
5554
public float getDamage() {
5655
return damage;
5756
}
5857

5958
/**
60-
* The direction in which the bullet is moving
59+
* @return the direction in which the bullet is moving
6160
*/
6261
public Direction getDir() {
6362
return dir;

src/main/battlecode/common/RobotController.java

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,8 @@ public strictfp interface RobotController {
177177
* @param radius the radius of the circle to check.
178178
* @return true if the circle is completely on the map, false otherwise.
179179
* @throws GameActionException if any portion of the given circle is not within sensor range.
180+
*
181+
* @battlecode.doc.costlymethod
180182
*/
181183
boolean onTheMap(MapLocation center, float radius) throws GameActionException;
182184

@@ -364,7 +366,7 @@ public strictfp interface RobotController {
364366
BulletInfo senseBullet(int id) throws GameActionException;
365367

366368
/**
367-
* Returns all robots that can be sensed on the map.
369+
* Returns all robots within sense radius.
368370
*
369371
* @return array of RobotInfo objects, which contain information about all
370372
* the robots you sensed.
@@ -378,7 +380,7 @@ public strictfp interface RobotController {
378380
* robot.
379381
*
380382
* @param radius return robots this distance away from the center of
381-
* this robot. If -1 is passed, robots from the whole map are returned.
383+
* this robot. If -1 is passed, all robots within sense radius are returned.
382384
* @return array of RobotInfo objects of all the robots you sensed.
383385
*
384386
* @battlecode.doc.costlymethod
@@ -390,7 +392,7 @@ public strictfp interface RobotController {
390392
* radius of this robot.
391393
*
392394
* @param radius return robots this distance away from the center of
393-
* this robot. If -1 is passed, robots from the whole map are returned.
395+
* this robot. If -1 is passed, all robots within sense radius are returned.
394396
* @param team filter game objects by the given team. If null is passed,
395397
* robots from any team are returned.
396398
* @return array of RobotInfo objects of all the robots you sensed.
@@ -405,7 +407,7 @@ public strictfp interface RobotController {
405407
*
406408
* @param center center of the given search radius.
407409
* @param radius return robots this distance away from the given center
408-
* location. If -1 is passed, robots from the whole map are returned.
410+
* location. If -1 is passed, all robots within sense radius are returned.
409411
* @param team filter game objects by the given team. If null is passed,
410412
* objects from all teams are returned.
411413
* @return array of RobotInfo objects of the robots you sensed.
@@ -415,7 +417,7 @@ public strictfp interface RobotController {
415417
RobotInfo[] senseNearbyRobots(MapLocation center, float radius, Team team);
416418

417419
/**
418-
* Returns all trees that can be sensed on the map.
420+
* Returns all trees within sense radius.
419421
*
420422
* @return array of TreeInfo objects, which contain information about all
421423
* the trees you sensed.
@@ -429,7 +431,7 @@ public strictfp interface RobotController {
429431
* robot.
430432
*
431433
* @param radius return trees this distance away from the center of
432-
* this robot. If -1 is passed, trees from the whole map are returned.
434+
* this robot. If -1 is passed, all trees within sense radius are returned.
433435
* @return array of TreeInfo objects of all the trees you sensed.
434436
*
435437
* @battlecode.doc.costlymethod
@@ -441,7 +443,7 @@ public strictfp interface RobotController {
441443
* radius of this robot.
442444
*
443445
* @param radius return trees this distance away from the center of
444-
* this robot. If -1 is passed, trees from the whole map are returned.
446+
* this robot. If -1 is passed, all trees within sense radius are returned.
445447
* @param team filter game objects by the given team. If null is passed,
446448
* robots from any team are returned.
447449
* @return array of TreeInfo objects of all the trees you sensed.
@@ -456,7 +458,7 @@ public strictfp interface RobotController {
456458
*
457459
* @param center center of the given search radius.
458460
* @param radius return trees this distance away from given center
459-
* location. If -1 is passed, trees from the whole map are returned.
461+
* location. If -1 is passed, all trees within sense radius are returned.
460462
* @param team filter game objects by the given team. If null is passed,
461463
* objects from all teams are returned.
462464
* @return array of TreeInfo objects of the trees you sensed.
@@ -466,7 +468,7 @@ public strictfp interface RobotController {
466468
TreeInfo[] senseNearbyTrees(MapLocation center, float radius, Team team);
467469

468470
/**
469-
* Returns all bullets that can be sensed on the map.
471+
* Returns all bullets within bullet sense radius.
470472
*
471473
* @return array of BulletInfo objects, which contain information about all
472474
* the bullets you sensed.
@@ -493,7 +495,7 @@ public strictfp interface RobotController {
493495
*
494496
* @param center center of the given search radius.
495497
* @param radius return bullets this distance away from the given center
496-
* location. If -1 is passed, bullets from the whole map are returned.
498+
* location. If -1 is passed, all bullets within bullet sense radius are returned..
497499
* @return array of TreeInfo objects of the bullets you sensed.
498500
*
499501
* @battlecode.doc.costlymethod
@@ -844,22 +846,24 @@ public strictfp interface RobotController {
844846
void shake(int id) throws GameActionException;
845847

846848
/**
847-
* Returns true if the robot can water a tree. Takes into accout the
849+
* Determines whether the robot can water a tree. Takes into accout the
848850
* robot's type, if it's already watered this turn, and if a valid
849-
* tree exists at this location within range.
851+
* tree at this location exists within range.
850852
*
851853
* @param loc The location of a tree to check.
854+
* @return true if this robot can water a tree, false otherwise.
852855
*
853856
* @battlecode.doc.costlymethod
854857
*/
855858
boolean canWater(MapLocation loc);
856859

857860
/**
858-
* Returns true if the robot can water a tree. Takes into accout the
861+
* Determines whether the robot can water a tree. Takes into accout the
859862
* robot's type, if it's already watered this turn, and if a valid
860-
* tree exists with this id within range
863+
* tree with this id exists within range.
861864
*
862865
* @param id The id of a tree to check.
866+
* @return true if this robot can water a tree, false otherwise.
863867
*
864868
* @battlecode.doc.costlymethod
865869
*/
@@ -1142,6 +1146,8 @@ public strictfp interface RobotController {
11421146
* @param green the green component of the dot's color.
11431147
* @param blue the blue component of the dot's color.
11441148
* @throws GameActionException if loc is not a valid location on the map
1149+
*
1150+
* @battlecode.doc.costlymethod
11451151
*/
11461152
void setIndicatorDot(MapLocation loc, int red, int green, int blue) throws GameActionException;
11471153

@@ -1154,6 +1160,8 @@ public strictfp interface RobotController {
11541160
* @param green the green component of the line's color.
11551161
* @param blue the blue component of the line's color.
11561162
* @throws GameActionException if startLoc or endLoc is not a valid location on the map
1163+
*
1164+
* @battlecode.doc.costlymethod
11571165
*/
11581166
void setIndicatorLine(MapLocation startLoc, MapLocation endLoc, int red, int green, int blue) throws GameActionException;
11591167

src/main/battlecode/common/RobotInfo.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,35 +85,35 @@ public RobotInfo(int ID, Team team, RobotType type, MapLocation location,
8585
}
8686

8787
/**
88-
* The Team that the robot is on.
88+
* @return the team that this robot is on
8989
*/
9090
public Team getTeam() {
9191
return team;
9292
}
9393

9494
/**
95-
* The type of the robot.
95+
* @return the type of this robot
9696
*/
9797
public RobotType getType() {
9898
return type;
9999
}
100100

101101
/**
102-
* The current health of the robot.
102+
* @return the current health of this robot
103103
*/
104104
public double getHealth() {
105105
return health;
106106
}
107107

108108
/**
109-
* The number of times this robot has attacked in the current turn
109+
* @return the number of times this robot has attacked in the current turn
110110
*/
111111
public int getAttackCount() {
112112
return attackCount;
113113
}
114114

115115
/**
116-
* The number of times this robot has moved in the current turn
116+
* @return the number of times this robot has moved in the current turn
117117
*/
118118
public int getMoveCount() {
119119
return moveCount;

src/main/battlecode/common/TreeInfo.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,37 +70,35 @@ public TreeInfo(int ID, Team team, MapLocation location,
7070
}
7171

7272
/**
73-
* The Team that the tree is on.
73+
* @return the team that this tree is on
7474
*/
7575
public Team getTeam() {
7676
return team;
7777
}
7878

7979
/**
80-
* The current health of the tree.
80+
* @return the current health of the tree
8181
*/
8282
public float getHealth() {
8383
return health;
8484
}
8585

8686
/**
87-
* The current maximum health of the tree.
87+
* @return the maximum health of this tree
8888
*/
8989
public float getMaxHealth() {
9090
return maxHealth;
9191
}
9292

9393
/**
94-
* The current amount of bullets contained within the tree.
95-
* Note: only NEUTRAL trees can contain bullets
94+
* @return the amount of bullets contained within this tree
9695
*/
9796
public int getContainedBullets() {
9897
return containedBullets;
9998
}
10099

101100
/**
102-
* The current amount of bullets contained within the tree.
103-
* Note: only NEUTRAL trees can contain bullets
101+
* @return the type of robot contained within this tree, or null if there is no robot
104102
*/
105103
public RobotType getContainedRobot() {
106104
return containedRobot;

0 commit comments

Comments
 (0)