Warning fix

This commit is contained in:
Anuken
2018-10-28 18:34:18 -04:00
parent 0f00074f77
commit ac918c1a81
3 changed files with 18 additions and 45 deletions
+1 -7
View File
@@ -160,7 +160,6 @@ project(":core") {
} }
dependencies { dependencies {
compileOnly project(":annotations")
build.finalizedBy(finish) build.finalizedBy(finish)
def comp = System.properties["release"] == null || System.properties["release"] == "false" def comp = System.properties["release"] == null || System.properties["release"] == "false"
@@ -179,13 +178,9 @@ project(":core") {
compile "com.badlogicgames.gdx:gdx:$gdxVersion" compile "com.badlogicgames.gdx:gdx:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-controllers:$gdxVersion" compile "com.badlogicgames.gdx:gdx-controllers:$gdxVersion"
compileOnly project(":annotations")
annotationProcessor project(":annotations") annotationProcessor project(":annotations")
} }
/*
compileJava.options.compilerArgs = [
"-processor", "io.anuke.annotations.RemoteMethodAnnotationProcessor,io.anuke.annotations.SerializeAnnotationProcessor"
]*/
} }
project(":server") { project(":server") {
@@ -198,7 +193,6 @@ project(":server") {
} }
dependencies { dependencies {
compileOnly project(":annotations")
compile project(":core") compile project(":core")
compile project(":kryonet") compile project(":kryonet")
@@ -128,7 +128,11 @@ public class BlockIndexer{
for(int ty = ry * structQuadrantSize; ty < (ry + 1) * structQuadrantSize && ty < world.height(); ty++){ for(int ty = ry * structQuadrantSize; ty < (ry + 1) * structQuadrantSize && ty < world.height(); ty++){
Tile other = world.tile(tx, ty); Tile other = world.tile(tx, ty);
if(other == null || other.entity == null || other.getTeam() != team || !pred.test(other) || !other.block().targetable) continue; if(other == null) continue;
other = other.target();
if(other.entity == null || other.getTeam() != team || !pred.test(other) || !other.block().targetable) continue;
TileEntity e = other.entity; TileEntity e = other.entity;
+12 -37
View File
@@ -41,16 +41,12 @@ public class Units{
return target == null || (range != Float.MAX_VALUE && target.distanceTo(x, y) > range) || target.getTeam() == team || !target.isValid(); return target == null || (range != Float.MAX_VALUE && target.distanceTo(x, y) > range) || target.getTeam() == team || !target.isValid();
} }
/** /**See {@link #invalidateTarget(TargetTrait, Team, float, float, float)}*/
* See {@link #invalidateTarget(TargetTrait, Team, float, float, float)}
*/
public static boolean invalidateTarget(TargetTrait target, Team team, float x, float y){ public static boolean invalidateTarget(TargetTrait target, Team team, float x, float y){
return invalidateTarget(target, team, x, y, Float.MAX_VALUE); return invalidateTarget(target, team, x, y, Float.MAX_VALUE);
} }
/** /**See {@link #invalidateTarget(TargetTrait, Team, float, float, float)}*/
* See {@link #invalidateTarget(TargetTrait, Team, float, float, float)}
*/
public static boolean invalidateTarget(TargetTrait target, Unit targeter){ public static boolean invalidateTarget(TargetTrait target, Unit targeter){
return invalidateTarget(target, targeter.team, targeter.x, targeter.y, targeter.getWeapon().getAmmo().getRange()); return invalidateTarget(target, targeter.team, targeter.x, targeter.y, targeter.getWeapon().getAmmo().getRange());
} }
@@ -129,16 +125,12 @@ public class Units{
return value[0]; return value[0];
} }
/** /**Returns the neareset ally tile in a range.*/
* Returns the neareset ally tile in a range.
*/
public static TileEntity findAllyTile(Team team, float x, float y, float range, Predicate<Tile> pred){ public static TileEntity findAllyTile(Team team, float x, float y, float range, Predicate<Tile> pred){
return world.indexer.findTile(team, x, y, range, pred); return world.indexer.findTile(team, x, y, range, pred);
} }
/** /**Returns the neareset enemy tile in a range.*/
* Returns the neareset enemy tile in a range.
*/
public static TileEntity findEnemyTile(Team team, float x, float y, float range, Predicate<Tile> pred){ public static TileEntity findEnemyTile(Team team, float x, float y, float range, Predicate<Tile> pred){
for(Team enemy : state.teams.enemiesOf(team)){ for(Team enemy : state.teams.enemiesOf(team)){
TileEntity entity = world.indexer.findTile(enemy, x, y, range, pred); TileEntity entity = world.indexer.findTile(enemy, x, y, range, pred);
@@ -149,9 +141,7 @@ public class Units{
return null; return null;
} }
/** /**Iterates over all units on all teams, including players.*/
* Iterates over all units on all teams, including players.
*/
public static void allUnits(Consumer<Unit> cons){ public static void allUnits(Consumer<Unit> cons){
//check all unit groups first //check all unit groups first
for(EntityGroup<BaseUnit> group : unitGroups){ for(EntityGroup<BaseUnit> group : unitGroups){
@@ -183,9 +173,7 @@ public class Units{
} }
} }
/** /**Returns the closest enemy of this team. Filter by predicate.*/
* Returns the closest enemy of this team. Filter by predicate.
*/
public static Unit getClosestEnemy(Team team, float x, float y, float range, Predicate<Unit> predicate){ public static Unit getClosestEnemy(Team team, float x, float y, float range, Predicate<Unit> predicate){
result = null; result = null;
cdist = 0f; cdist = 0f;
@@ -208,9 +196,7 @@ public class Units{
return result; return result;
} }
/** /**Returns the closest ally of this team. Filter by predicate.*/
* Returns the closest ally of this team. Filter by predicate.
*/
public static Unit getClosest(Team team, float x, float y, float range, Predicate<Unit> predicate){ public static Unit getClosest(Team team, float x, float y, float range, Predicate<Unit> predicate){
result = null; result = null;
cdist = 0f; cdist = 0f;
@@ -233,9 +219,7 @@ public class Units{
return result; return result;
} }
/** /**Iterates over all units in a rectangle.*/
* Iterates over all units in a rectangle.
*/
public static void getNearby(Team team, Rectangle rect, Consumer<Unit> cons){ public static void getNearby(Team team, Rectangle rect, Consumer<Unit> cons){
EntityGroup<BaseUnit> group = unitGroups[team.ordinal()]; EntityGroup<BaseUnit> group = unitGroups[team.ordinal()];
@@ -249,9 +233,7 @@ public class Units{
}); });
} }
/** /**Iterates over all units in a circle around this position.*/
* Iterates over all units in a circle around this position.
*/
public static void getNearby(Team team, float x, float y, float radius, Consumer<Unit> cons){ public static void getNearby(Team team, float x, float y, float radius, Consumer<Unit> cons){
rect.setSize(radius * 2).setCenter(x, y); rect.setSize(radius * 2).setCenter(x, y);
@@ -272,9 +254,7 @@ public class Units{
}); });
} }
/** /**Iterates over all units in a rectangle.*/
* Iterates over all units in a rectangle.
*/
public static void getNearby(Rectangle rect, Consumer<Unit> cons){ public static void getNearby(Rectangle rect, Consumer<Unit> cons){
for(Team team : Team.all){ for(Team team : Team.all){
@@ -288,9 +268,7 @@ public class Units{
EntityQuery.getNearby(playerGroup, rect, player -> cons.accept((Unit) player)); EntityQuery.getNearby(playerGroup, rect, player -> cons.accept((Unit) player));
} }
/** /**Iterates over all units that are enemies of this team.*/
* Iterates over all units that are enemies of this team.
*/
public static void getNearbyEnemies(Team team, Rectangle rect, Consumer<Unit> cons){ public static void getNearbyEnemies(Team team, Rectangle rect, Consumer<Unit> cons){
EnumSet<Team> targets = state.teams.enemiesOf(team); EnumSet<Team> targets = state.teams.enemiesOf(team);
@@ -309,9 +287,7 @@ public class Units{
}); });
} }
/** /**Iterates over all units.*/
* Iterates over all units.
*/
public static void getAllUnits(Consumer<Unit> cons){ public static void getAllUnits(Consumer<Unit> cons){
for(Team team : Team.all){ for(Team team : Team.all){
@@ -327,5 +303,4 @@ public class Units{
} }
} }
} }