Methapolis  0.27
 All Classes Namespaces Files Functions Variables Enumerator
TranslatedToolEffect.java
Go to the documentation of this file.
1 // This file is part of MicropolisJ.
2 // Copyright (C) 2013 Jason Long
3 // Portions Copyright (C) 1989-2007 Electronic Arts Inc.
4 //
5 // MicropolisJ is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU GPLv3, with additional terms.
7 // See the README file, included in this distribution, for details.
8 
9 package micropolisj.engine;
10 
11 class TranslatedToolEffect implements ToolEffectIfc
12 {
13  public final ToolEffectIfc base;
14  public final int dx;
15  public final int dy;
16 
17  TranslatedToolEffect(ToolEffectIfc base, int dx, int dy)
18  {
19  this.base = base;
20  this.dx = dx;
21  this.dy = dy;
22  }
23 
24  //implements ToolEffectIfc
25  public int getTile(int x, int y)
26  {
27  return base.getTile(x+dx, y+dy);
28  }
29 
30  //implements ToolEffectIfc
31  public void makeSound(int x, int y, Sound sound)
32  {
33  base.makeSound(x+dx, y+dy, sound);
34  }
35 
36  //implements ToolEffectIfc
37  public void setTile(int x, int y, int tileValue)
38  {
39  base.setTile(x+dx, y+dy, tileValue);
40  }
41 
42  //implements ToolEffectIfc
43  public void spend(int amount)
44  {
45  base.spend(amount);
46  }
47 
48  //implements ToolEffectIfc
49  public void toolResult(ToolResult tr)
50  {
51  base.toolResult(tr);
52  }
53 
54  public int getPlayerID() {
55  return base.getPlayerID();
56  }
57 }