Skip to content

Commit b3855c0

Browse files
committed
intelliJ cleanup
1 parent 0972118 commit b3855c0

27 files changed

+501
-736
lines changed

src/main/java/bwapi/BuildingPlacer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ private static void ReservePlacement(final PlacementReserve reserve, final UnitT
159159
//if ( !GetBunkerPlacement() ){
160160
//reserveTurretPlacement();
161161
//}
162-
break;
162+
break;
163163
case Terran_Missile_Turret: // @TODO
164164
case Protoss_Photon_Cannon:
165165
//reserveTurretPlacement();
@@ -168,7 +168,7 @@ private static void ReservePlacement(final PlacementReserve reserve, final UnitT
168168
//if ( creep || !GetBunkerPlacement() ){
169169
//reserveTurretPlacement();
170170
// }
171-
break;
171+
break;
172172
default:
173173
if (!type.isResourceDepot()) {
174174
ReserveDefault(reserve, type, desiredPosition, game);

src/main/java/bwapi/Bullet.java

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,24 @@
66

77
/**
88
* An object representing a bullet or missile spawned from an attack.
9-
*
9+
* <p>
1010
* The Bullet interface allows you to detect bullets, missiles, and other types
1111
* of non-melee attacks or special abilities that would normally be visible through
1212
* human eyes (A lurker spike or a Queen's flying parasite), allowing quicker reaction
1313
* to unavoidable consequences.
14-
*
14+
* <p>
1515
* For example, ordering medics to restore units that are about to receive a lockdown
1616
* to compensate for latency and minimize its effects. You can't know entirely which unit
1717
* will be receiving a lockdown unless you can detect the lockdown missile using the
1818
* {@link Bullet} class.
19-
*
19+
* <p>
2020
* {@link Bullet} objects are re-used after they are destroyed, however their ID is updated when it
2121
* represents a new Bullet.
22-
*
22+
* <p>
2323
* If {@link Flag#CompleteMapInformation} is disabled, then a {@link Bullet} is accessible if and only if
2424
* it is visible. Otherwise if {@link Flag#CompleteMapInformation} is enabled, then all Bullets
2525
* in the game are accessible.
26+
*
2627
* @see Game#getBullets
2728
* @see Bullet#exists
2829
*/
@@ -40,22 +41,22 @@ public class Bullet implements Comparable<Bullet> {
4041
/**
4142
* Retrieves a unique identifier for the current {@link Bullet}.
4243
*
43-
* @return An integer value containing the identifier.
44+
* @return An integer value containing the identifier.
4445
*/
4546
public int getID() {
4647
return id;
4748
}
4849

4950
/**
5051
* Checks if the {@link Bullet} exists in the view of the BWAPI player.
51-
*
52+
* <p>
5253
* If {@link Flag#CompleteMapInformation} is disabled, and a {@link Bullet} is not visible, then the
5354
* return value will be false regardless of the Bullet's true existence. This is because
5455
* absolutely no state information on invisible enemy bullets is made available to the AI.
55-
*
56+
* <p>
5657
* If {@link Flag#CompleteMapInformation} is enabled, then this function is accurate for all
5758
* {@link Bullet} information.
58-
*
59+
*
5960
* @return true if the bullet exists or is visible, false if the bullet was destroyed or has gone out of scope.
6061
* @see #isVisible
6162
* @see Unit#exists
@@ -67,7 +68,7 @@ public boolean exists() {
6768
/**
6869
* Retrieves the {@link Player} interface that owns the Bullet.
6970
*
70-
* @return The owning {@link Player} object. Returns null if the {@link Player} object for this {@link Bullet} is inaccessible.
71+
* @return The owning {@link Player} object. Returns null if the {@link Player} object for this {@link Bullet} is inaccessible.
7172
*/
7273
public Player getPlayer() {
7374
return game.getPlayer(bulletData.getPlayer());
@@ -76,7 +77,7 @@ public Player getPlayer() {
7677
/**
7778
* Retrieves the type of this {@link Bullet}.
7879
*
79-
* @return A {@link BulletType} representing the Bullet's type. Returns {@link BulletType#Unknown} if the {@link Bullet} is inaccessible.
80+
* @return A {@link BulletType} representing the Bullet's type. Returns {@link BulletType#Unknown} if the {@link Bullet} is inaccessible.
8081
*/
8182
public BulletType getType() {
8283
return BulletType.idToEnum[bulletData.getType()];
@@ -85,7 +86,7 @@ public BulletType getType() {
8586
/**
8687
* Retrieves the {@link Unit} that the {@link Bullet} spawned from.
8788
*
88-
* @return The owning {@link Unit} object. Returns null if the source can not be identified or is inaccessible.
89+
* @return The owning {@link Unit} object. Returns null if the source can not be identified or is inaccessible.
8990
* @see #getTarget
9091
*/
9192
public Unit getSource() {
@@ -95,7 +96,7 @@ public Unit getSource() {
9596
/**
9697
* Retrieves the Bullet's current position.
9798
*
98-
* @return A {@link Position} containing the Bullet's current coordinates. Returns {@link Position#Unknown} if the {@link Bullet} is inaccessible.
99+
* @return A {@link Position} containing the Bullet's current coordinates. Returns {@link Position#Unknown} if the {@link Bullet} is inaccessible.
99100
* @see #getTargetPosition
100101
*/
101102
public Position getPosition() {
@@ -106,7 +107,7 @@ public Position getPosition() {
106107
* Retrieve's the direction the {@link Bullet} is facing. If the angle is 0, then
107108
* the {@link Bullet} is facing right.
108109
*
109-
* @return A double representing the direction the {@link Bullet} is facing. Returns 0.0 if the bullet is inaccessible.
110+
* @return A double representing the direction the {@link Bullet} is facing. Returns 0.0 if the bullet is inaccessible.
110111
*/
111112
public double getAngle() {
112113
return bulletData.getAngle();
@@ -115,8 +116,7 @@ public double getAngle() {
115116
/**
116117
* Retrieves the X component of the Bullet's velocity, measured in pixels per frame.
117118
*
118-
* @return A double representing the number of pixels moved on the X axis per frame. Returns 0.0 if the {@link Bullet} is inaccessible.
119-
*
119+
* @return A double representing the number of pixels moved on the X axis per frame. Returns 0.0 if the {@link Bullet} is inaccessible.
120120
* @see #getVelocityY
121121
* @see #getAngle
122122
*/
@@ -127,8 +127,7 @@ public double getVelocityX() {
127127
/**
128128
* Retrieves the Y component of the Bullet's velocity, measured in pixels per frame.
129129
*
130-
* @return A double representing the number of pixels moved on the Y axis per frame. Returns 0.0 if the {@link Bullet} is inaccessible.
131-
*
130+
* @return A double representing the number of pixels moved on the Y axis per frame. Returns 0.0 if the {@link Bullet} is inaccessible.
132131
* @see #getVelocityX
133132
* @see #getAngle
134133
*/
@@ -139,7 +138,7 @@ public double getVelocityY() {
139138
/**
140139
* Retrieves the Unit interface that the {@link Bullet} is heading to.
141140
*
142-
* @return The target Unit object, if one exists. Returns null if the Bullet's target {@link Unit} is inaccessible, the {@link Bullet} is targetting the ground, or if the {@link Bullet} itself is inaccessible.
141+
* @return The target Unit object, if one exists. Returns null if the Bullet's target {@link Unit} is inaccessible, the {@link Bullet} is targetting the ground, or if the {@link Bullet} itself is inaccessible.
143142
* @see #getTargetPosition
144143
* @see #getSource
145144
*/
@@ -150,7 +149,7 @@ public Unit getTarget() {
150149
/**
151150
* Retrieves the target position that the {@link Bullet} is heading to.
152151
*
153-
* @return A {@link Position} indicating where the {@link Bullet} is headed. Returns {@link Position#Unknown} if the bullet is inaccessible.
152+
* @return A {@link Position} indicating where the {@link Bullet} is headed. Returns {@link Position#Unknown} if the bullet is inaccessible.
154153
* @see #getTarget
155154
* @see #getPosition
156155
*/
@@ -160,12 +159,12 @@ public Position getTargetPosition() {
160159

161160
/**
162161
* Retrieves the timer that indicates the Bullet's life span.
163-
*
162+
* <p>
164163
* Bullets are not permanent objects, so they will often have a limited life span.
165164
* This life span is measured in frames. Normally a Bullet will reach its target
166165
* before being removed.
167166
*
168-
* @return An integer representing the remaining number of frames until the {@link Bullet} self-destructs. Returns 0 if the {@link Bullet} is inaccessible.
167+
* @return An integer representing the remaining number of frames until the {@link Bullet} self-destructs. Returns 0 if the {@link Bullet} is inaccessible.
169168
*/
170169
public int getRemoveTimer() {
171170
return bulletData.getRemoveTimer();
@@ -179,7 +178,6 @@ public boolean isVisible() {
179178
* Retrieves the visibility state of the Bullet.
180179
*
181180
* @param player If this parameter is specified, then the Bullet's visibility to the given player is checked. If this parameter is omitted, then a default value of null is used, which will check if the BWAPI player has vision of the {@link Bullet}.
182-
*
183181
* @return true if the {@link Bullet} is visible to the specified player, false if the {@link Bullet} is not visible to the specified player.
184182
*/
185183
public boolean isVisible(final Player player) {

src/main/java/bwapi/BulletType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
/**
66
* This enum represents a type of bullet.
7-
*
7+
* <p>
88
* Internally, these are the same IDs as flingy types in Broodwar.
99
*/
1010
public enum BulletType {

src/main/java/bwapi/Color.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
/**
77
* The Color object is used in drawing routines to specify the color to use.
8-
*
8+
* <p>
99
* Starcraft uses a 256 color palette for rendering. Thus, the colors available are
1010
* limited to this palette.
1111
*/
@@ -97,6 +97,7 @@ RGBRESERVE, RGBRESERVE, RGBRESERVE, RGBRESERVE, RGBRESERVE, RGBRESERVE, RGBRESER
9797
};
9898

9999
private static final byte[][][] closestColor = new byte[64][64][64];
100+
100101
static {
101102
for (int r = 0; r < 64; ++r) {
102103
for (int g = 0; g < 64; ++g) {
@@ -106,17 +107,18 @@ RGBRESERVE, RGBRESERVE, RGBRESERVE, RGBRESERVE, RGBRESERVE, RGBRESERVE, RGBRESER
106107
}
107108
}
108109
}
110+
109111
public final int id;
110112

111113
/**
112114
* A constructor that uses the color index in the palette that is closest to the
113115
* given rgb values. On its first call, the colors in the palette will be sorted for fast indexing.
114-
*
116+
* <p>
115117
* This function computes the distance of the RGB values and may not be accurate.
116118
*
117-
* @param red The amount of red.
119+
* @param red The amount of red.
118120
* @param green The amount of green.
119-
* @param blue The amount of blue.
121+
* @param blue The amount of blue.
120122
*/
121123
public Color(final int red, final int green, final int blue) {
122124
id = getRGBIndex(red, green, blue);

src/main/java/bwapi/DamageType.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
/**
44
* Damage types are used in Broodwar to determine the amount of damage that will be
55
* done to a unit.
6-
*
6+
* <p>
77
* This corresponds with UnitSizeType to determine the damage done to
88
* a unit.
99
*
1010
* @see WeaponType
1111
* @see DamageType
1212
* @see UnitSizeType
13-
*
13+
* <p>
1414
* [View on Liquipedia](http://wiki.teamliquid.net/starcraft/Damage_Type)<br>
1515
* [View on Starcraft Campendium (Official Website)](http://classic.battle.net/scc/gs/damage.shtml)<br>
1616
* [View on Starcraft Wikia](http://starcraft.wikia.com/wiki/Damage_types)<br>

src/main/java/bwapi/ExplosionType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
/**
44
* A representation of a weapon's explosion type.
5-
*
5+
* <p>
66
* This indicates how the weapon behaves, such as if it deals splash damage or causes an effect to occur.
77
*/
88
public enum ExplosionType {

src/main/java/bwapi/Flag.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
/**
44
* Contains flag enumerations for BWAPI.
5+
*
56
* @see Game#enableFlag
67
* @see Game#isFlagEnabled
78
*/

src/main/java/bwapi/Force.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,11 @@
99
/**
1010
* The {@link Force} class is used to get information about each force in a match.
1111
* Normally this is considered a team.
12-
*
12+
* <p>
1313
* It is not called a team because players on the same force do not necessarily need
1414
* to be allied at the beginning of a match.
15-
*
1615
*/
17-
public class Force implements Comparable<Force>{
16+
public class Force implements Comparable<Force> {
1817
private final Game game;
1918

2019
private final int id;
@@ -29,7 +28,7 @@ public class Force implements Comparable<Force>{
2928
/**
3029
* Retrieves the unique ID that represents this {@link Force}.
3130
*
32-
* @return An integer containing the ID for the {@link Force}.
31+
* @return An integer containing the ID for the {@link Force}.
3332
*/
3433
public int getID() {
3534
return id;
@@ -38,7 +37,7 @@ public int getID() {
3837
/**
3938
* Retrieves the name of the {@link Force}.
4039
*
41-
* @return A String object containing the name of the force.
40+
* @return A String object containing the name of the force.
4241
*/
4342
public String getName() {
4443
return name;
@@ -47,7 +46,7 @@ public String getName() {
4746
/**
4847
* Retrieves the set of players that belong to this {@link Force}.
4948
*
50-
* @return A List<Player> object containing the players that are part of this {@link Force}.
49+
* @return A List<Player> object containing the players that are part of this {@link Force}.
5150
*/
5251
public List<Player> getPlayers() {
5352
return game.getPlayers().stream()

0 commit comments

Comments
 (0)