You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Retrieve's the direction the {@link Bullet} is facing. If the angle is 0, then
107
+
* the {@link Bullet} is facing right.
108
+
*
109
+
* @return A double representing the direction the {@link Bullet} is facing. Returns 0.0 if the bullet is inaccessible.
110
+
*/
42
111
publicdoublegetAngle() {
43
112
returnbulletData.getAngle();
44
113
}
45
114
115
+
/**
116
+
* Retrieves the X component of the Bullet's velocity, measured in pixels per frame.
117
+
*
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
+
*
120
+
* @see #getVelocityY
121
+
* @see #getAngle
122
+
*/
46
123
publicdoublegetVelocityX() {
47
124
returnbulletData.getVelocityX();
48
125
}
49
126
127
+
/**
128
+
* Retrieves the Y component of the Bullet's velocity, measured in pixels per frame.
129
+
*
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
+
*
132
+
* @see #getVelocityX
133
+
* @see #getAngle
134
+
*/
50
135
publicdoublegetVelocityY() {
51
136
returnbulletData.getVelocityY();
52
137
}
53
138
139
+
/**
140
+
* Retrieves the Unit interface that the {@link Bullet} is heading to.
141
+
*
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.
143
+
* @see #getTargetPosition
144
+
* @see #getSource
145
+
*/
54
146
publicUnitgetTarget() {
55
147
returngame.getUnit(bulletData.getTarget());
56
148
}
57
149
150
+
/**
151
+
* Retrieves the target position that the {@link Bullet} is heading to.
152
+
*
153
+
* @return A {@link Position} indicating where the {@link Bullet} is headed. Returns {@link Position#Unknown} if the bullet is inaccessible.
* Retrieves the timer that indicates the Bullet's life span.
163
+
*
164
+
* Bullets are not permanent objects, so they will often have a limited life span.
165
+
* This life span is measured in frames. Normally a Bullet will reach its target
166
+
* before being removed.
167
+
*
168
+
* @return An integer representing the remaining number of frames until the {@link Bullet} self-destructs. Returns 0 if the {@link Bullet} is inaccessible.
169
+
*/
62
170
publicintgetRemoveTimer() {
63
171
returnbulletData.getRemoveTimer();
64
172
}
@@ -67,7 +175,17 @@ public boolean isVisible() {
67
175
returnisVisible(game.self());
68
176
}
69
177
178
+
/**
179
+
* Retrieves the visibility state of the Bullet.
180
+
*
181
+
* @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
+
*
183
+
* @return true if the {@link Bullet} is visible to the specified player, false if the {@link Bullet} is not visible to the specified player.
0 commit comments