These things exist now

This commit is contained in:
Anuken
2021-11-04 22:34:42 -04:00
parent 5fe8ed88a6
commit 189604474c
@@ -280,11 +280,13 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
} }
public Building nearby(int rotation){ public Building nearby(int rotation){
if(rotation == 0) return world.build(tile.x + 1, tile.y); return switch(rotation){
if(rotation == 1) return world.build(tile.x, tile.y + 1); case 0 -> world.build(tile.x + 1, tile.y);
if(rotation == 2) return world.build(tile.x - 1, tile.y); case 1 -> world.build(tile.x, tile.y + 1);
if(rotation == 3) return world.build(tile.x, tile.y - 1); case 2 -> world.build(tile.x - 1, tile.y);
return null; case 3 -> world.build(tile.x, tile.y - 1);
default -> null;
};
} }
public byte relativeTo(Tile tile){ public byte relativeTo(Tile tile){