Successful desktop compilation

This commit is contained in:
Anuken
2018-12-26 17:38:40 -05:00
parent 8879593381
commit 3b42b604e1
53 changed files with 560 additions and 585 deletions
@@ -93,28 +93,6 @@ public class NetworkIO{
}
}
//write visibility, length-run encoded
for(int i = 0; i < world.width() * world.height(); i++){
Tile tile = world.tile(i % world.width(), i / world.width());;
boolean discovered = tile.discovered();
int consecutives = 0;
for(int j = i + 1; j < world.width() * world.height() && consecutives < 32767*2-1; j++){
Tile nextTile = world.tile(j % world.width(), j / world.width());;
if(nextTile.discovered() != discovered){
break;
}
consecutives++;
}
stream.writeBoolean(discovered);
stream.writeShort(consecutives);
i += consecutives;
}
stream.write(Team.all.length);
//write team data
@@ -247,18 +225,6 @@ public class NetworkIO{
tiles[x][y] = tile;
}
for(int i = 0; i < width * height; i++){
boolean discovered = stream.readBoolean();
int consecutives = stream.readUnsignedShort();
if(discovered){
for(int j = i + 1; j < i + 1 + consecutives; j++){
int newx = j % width, newy = j / width;
tiles[newx][newy].setVisibility((byte) 1);
}
}
i += consecutives;
}
state.teams = new Teams();
byte teams = stream.readByte();