toolstroke: apply ToolEffect-conversion to fixZone()

git-svn-id: https://micropolis.googlecode.com/svn/trunk/micropolis-java@635 d9718cc8-9f43-0410-858b-315f434eb58c
This commit is contained in:
jason@long.name 2013-05-16 23:43:46 +00:00
parent c9b21e4f23
commit 5b5e278393

View file

@ -457,22 +457,22 @@ public class ToolStroke
}
protected void fixZone(int xpos, int ypos)
{
fixSingle(xpos, ypos);
if (ypos > 0)
fixSingle(xpos, ypos - 1);
if (xpos > 0)
fixSingle(xpos - 1, ypos);
if (xpos + 1 < city.getWidth())
fixSingle(xpos + 1, ypos);
if (ypos + 1 < city.getHeight())
fixSingle(xpos, ypos + 1);
}
private void fixSingle(int xpos, int ypos)
{
ToolEffect eff = new ToolEffect(city, xpos, ypos);
fixSingle(eff);
// "fix" the cells to the north, west, east, and south
fixSingle(new TranslatedToolEffect(eff, 0, -1));
fixSingle(new TranslatedToolEffect(eff, -1, 0));
fixSingle(new TranslatedToolEffect(eff, 1, 0));
fixSingle(new TranslatedToolEffect(eff, 0, 1));
eff.apply();
}
private void fixSingle(ToolEffectIfc eff)
{
int tile = (eff.getTile(0, 0) & LOMASK);
tile = neutralizeRoad(tile);
@ -665,7 +665,6 @@ public class ToolStroke
eff.setTile(0, 0, (WireTable[adjTile] | BULLBIT | BURNBIT | CONDBIT));
} //end if on a rail tile
eff.apply();
return;
}