Skip to content

Commit

Permalink
Preliminary javadocs and bytecode costs
Browse files Browse the repository at this point in the history
  • Loading branch information
j-mao committed Jan 2, 2022
1 parent c8b8b26 commit ddb0587
Show file tree
Hide file tree
Showing 9 changed files with 197 additions and 131 deletions.
20 changes: 6 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -272,13 +272,6 @@ task releaseClientLinux32(type: Zip, dependsOn: ['prodClient']) {



task updateVersion() {
// new File("frontend/public/version.txt").write(project.findProperty('release_version'))
}



publish.dependsOn(updateVersion)
publishing {
repositories {
maven {
Expand All @@ -296,11 +289,10 @@ publishing {
publications {
server(MavenPublication) {
groupId 'org.battlecode'
artifactId 'battlecode21'
artifactId 'battlecode22'
version project.findProperty('release_version') ?: 'NONSENSE'

artifact release_main


artifact release_docs {
classifier 'javadoc'
Expand All @@ -312,39 +304,39 @@ publishing {

clientWin(MavenPublication) {
groupId 'org.battlecode'
artifactId 'battlecode21-client-win'
artifactId 'battlecode22-client-win'
version project.findProperty('release_version') ?: 'NONSENSE'

artifact releaseClientWin
}

clientMac(MavenPublication) {
groupId 'org.battlecode'
artifactId 'battlecode21-client-mac'
artifactId 'battlecode22-client-mac'
version project.findProperty('release_version') ?: 'NONSENSE'

artifact releaseClientMac
}

clientLinux(MavenPublication) {
groupId 'org.battlecode'
artifactId 'battlecode21-client-linux'
artifactId 'battlecode22-client-linux'
version project.findProperty('release_version') ?: 'NONSENSE'

artifact releaseClientLinux
}

clientWin32(MavenPublication) {
groupId 'org.battlecode'
artifactId 'battlecode21-client-win-32'
artifactId 'battlecode22-client-win-32'
version project.findProperty('release_version') ?: 'NONSENSE'

artifact releaseClientWin32
}

clientLinux32(MavenPublication) {
groupId 'org.battlecode'
artifactId 'battlecode21-client-linux-32'
artifactId 'battlecode22-client-linux-32'
version project.findProperty('release_version') ?: 'NONSENSE'

artifact releaseClientLinux32
Expand Down
7 changes: 7 additions & 0 deletions engine/src/main/battlecode/common/AnomalyScheduleEntry.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
package battlecode.common;

/**
* AnomalyScheduleEntry describes a single anomaly in the schedule.
*
* You can access information about that anomaly's round number and type.
*/
public class AnomalyScheduleEntry {

public final int roundNumber;
Expand All @@ -22,6 +27,8 @@ public AnomalyScheduleEntry copyEntry() {
*
* @param other the other anomaly schedule entry to compare to
* @return whether the two anomaly schedules entry are equivalent
*
* @battlecode.doc.costlymethod
*/
public boolean equals(AnomalyScheduleEntry other) {
if (this.roundNumber != other.roundNumber) return false;
Expand Down
6 changes: 4 additions & 2 deletions engine/src/main/battlecode/common/AnomalyType.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package battlecode.common;

/**
* Holds the different anomalies in the game.
* AnomalyType enumerates the different types of anomalies in the game.
* You can also access properties about these anomalies, such as their strengths
* and whether they can be performed by Sages.
*/
public enum AnomalyType {
ABYSS (true, true, 0.1f, 0.2f),
Expand All @@ -21,4 +23,4 @@ public enum AnomalyType {
this.globalPercentage = globalPercentage;
this.sagePercentage = sagePercentage;
}
}
}
28 changes: 0 additions & 28 deletions engine/src/main/battlecode/common/BodyInfo.java

This file was deleted.

2 changes: 1 addition & 1 deletion engine/src/main/battlecode/common/GameConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public class GameConstants {
// ****** COOLDOWNS ****************
// *********************************

/** If the number of cooldown turns is >= this number, a robot cannot act. */
/** If the amount of cooldown is at least this value, a robot cannot act. */
public static final int COOLDOWN_LIMIT = 10;

/** The number of cooldown turns reduced per turn. */
Expand Down
14 changes: 13 additions & 1 deletion engine/src/main/battlecode/common/RobotController.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public strictfp interface RobotController {
/**
* Returns the amount of lead a team has in its reserves.
*
* @param team the team being queried.
* @return the amount of lead a team has in its reserves.
*
* @battlecode.doc.costlymethod
Expand All @@ -75,6 +76,7 @@ public strictfp interface RobotController {
/**
* Returns the amount of gold a team has in its reserves.
*
* @param team the team being queried.
* @return the amount of gold a team has in its reserves.
*
* @battlecode.doc.costlymethod
Expand Down Expand Up @@ -346,6 +348,7 @@ public strictfp interface RobotController {
* @param center the given location
* @param radiusSquared return locations within this distance away from center
* @return list of locations on the map and within radiusSquared of center
* @throws GameActionException if the radius is negative
*
* @battlecode.doc.costlymethod
*/
Expand Down Expand Up @@ -504,6 +507,7 @@ public strictfp interface RobotController {
/**
* Attack a given location.
*
* @param loc the target location to attack
* @throws GameActionException if conditions for attacking are not satisfied
*
* @battlecode.doc.costlymethod
Expand All @@ -519,6 +523,7 @@ public strictfp interface RobotController {
*
* Checks that the robot is a sage, and there are no cooldown turns remaining.
*
* @param anomaly the type of anomaly being queried
* @return whether it is possible to envision an anomaly centered at the robots location
*
* @battlecode.doc.costlymethod
Expand All @@ -528,6 +533,7 @@ public strictfp interface RobotController {
/**
* Envision an anomaly centered at the robot's location.
*
* @param anomaly the type of anomaly to envision
* @throws GameActionException if conditions for envisioning are not satisfied
*
* @battlecode.doc.costlymethod
Expand Down Expand Up @@ -556,6 +562,7 @@ public strictfp interface RobotController {
/**
* Repairs at a given location.
*
* @param loc target location to repair at
* @throws GameActionException if conditions for repairing are not satisfied
*
* @battlecode.doc.costlymethod
Expand Down Expand Up @@ -584,6 +591,7 @@ public strictfp interface RobotController {
/**
* Mine lead at a given location.
*
* @param loc target location to mine
* @throws GameActionException if conditions for mining are not satisfied
*
* @battlecode.doc.costlymethod
Expand All @@ -608,6 +616,7 @@ public strictfp interface RobotController {
/**
* Mine a gold at given location.
*
* @param loc target location to mine
* @throws GameActionException if conditions for mining are not satisfied
*
* @battlecode.doc.costlymethod
Expand Down Expand Up @@ -636,6 +645,7 @@ public strictfp interface RobotController {
/**
* Mutate a building at a given location.
*
* @param loc target location of the building to mutate
* @throws GameActionException if conditions for mutating are not satisfied
*
* @battlecode.doc.costlymethod
Expand Down Expand Up @@ -707,7 +717,7 @@ public strictfp interface RobotController {
*
* @param index the index in the team's shared array, 0-indexed
* @return the value at that index in the team's shared array,
* or -1 if the index is invalid
* @throws GameActionException if the index is invalid
*
* @battlecode.doc.costlymethod
*/
Expand All @@ -719,6 +729,8 @@ public strictfp interface RobotController {
*
* @param index the index in the team's shared array, 0-indexed
* @param value the value to set that index to
* @throws GameActionException if the index is invalid, or the value
* is out of bounds
*
* @battlecode.doc.costlymethod
*/
Expand Down
Loading

0 comments on commit ddb0587

Please sign in to comment.