This commit is contained in:
Anuken
2022-06-08 09:05:25 -04:00
parent b9297a83b0
commit b2353eba58
2 changed files with 14 additions and 12 deletions

View File

@@ -507,19 +507,23 @@ public class Tile implements Position, QuadTreeObject, Displayable{
}
public @Nullable Tile nearby(int rotation){
if(rotation == 0) return world.tile(x + 1, y);
if(rotation == 1) return world.tile(x, y + 1);
if(rotation == 2) return world.tile(x - 1, y);
if(rotation == 3) return world.tile(x, y - 1);
return null;
return switch(rotation){
case 0 -> world.tile(x + 1, y);
case 1 -> world.tile(x, y + 1);
case 2 -> world.tile(x - 1, y);
case 3 -> world.tile(x, y - 1);
default -> null;
};
}
public @Nullable Building nearbyBuild(int rotation){
if(rotation == 0) return world.build(x + 1, y);
if(rotation == 1) return world.build(x, y + 1);
if(rotation == 2) return world.build(x - 1, y);
if(rotation == 3) return world.build(x, y - 1);
return null;
return switch(rotation){
case 0 -> world.build(x + 1, y);
case 1 -> world.build(x, y + 1);
case 2 -> world.build(x - 1, y);
case 3 -> world.build(x, y - 1);
default -> null;
};
}
public boolean interactable(Team team){