| 11 | import static micropolisj.engine.TileConstants.*; |
| 12 | |
| 13 | class BuildingTool extends ToolStroke |
| 14 | { |
| 15 | public BuildingTool(Micropolis engine, MicropolisTool tool, int xpos, int ypos) |
| 16 | { |
| 17 | super(engine, tool, xpos, ypos); |
| 18 | } |
| 19 | |
| 20 | @Override |
| 21 | public void dragTo(int xdest, int ydest) |
| 22 | { |
| 23 | this.xpos = xdest; |
| 24 | this.ypos = ydest; |
| 25 | this.xdest = xdest; |
| 26 | this.ydest = ydest; |
| 27 | } |
| 28 | |
| 29 | @Override |
| 30 | boolean apply1(ToolEffectIfc eff) |
| 31 | { |
| 32 | switch (tool) |
| 33 | { |
| 34 | case FIRE: |
| 35 | return applyZone(eff, FIRESTATION); |
| 36 | |
| 37 | case POLICE: |
| 38 | return applyZone(eff, POLICESTATION); |
| 39 | |
| 40 | case POWERPLANT: |
| 41 | return applyZone(eff, POWERPLANT); |
| 42 | |
| 43 | case STADIUM: |
| 44 | return applyZone(eff, STADIUM); |
| 45 | |
| 46 | case SEAPORT: |
| 47 | return applyZone(eff, PORT); |
| 48 | |
| 49 | case NUCLEAR: |
| 50 | return applyZone(eff, NUCLEAR); |
| 51 | |
| 52 | case AIRPORT: |
| 53 | return applyZone(eff, AIRPORT); |
| 54 | |
| 55 | default: |
| 56 | // not expected |
| 57 | throw new Error("unexpected tool: "+tool); |
| 58 | } |
| 59 | } |
| 60 | } |
nothing calls this directly
no outgoing calls
no test coverage detected