1 package se
.umu
.cs
.dit06ajnajs
.level
;
4 import se
.umu
.cs
.dit06ajnajs
.agent
.Tower
;
7 * A MapSquare that can be used by Towers.
9 * @author Anton Johansson (dit06ajn@cs.umu.se)
10 * @author Andreas Jacobsson (dit06ajs@cs.umu.se)
13 public class TowerSquare
extends MapSquare
{
16 private boolean available
;
19 * Creates a new TowerSquare, calls extended MapSquares contructor with
20 * supplied parameters. Sets this StartSquare as available for Towers.
22 * @param x The x-coordinate of this Square.
23 * @param y The y-coordinate of this Square.
24 * @param img The Image used to display this Square.
26 public TowerSquare(int x
, int y
, Image img
) {
28 this.available
= true;
32 * Sets a Tower on this square. Square is marked as not available.
34 * @param tower The Tower to add to this square.
36 public void setTower(Tower tower
) {
42 * Returns the Tower on this square.
44 * @return The Tower on this square.
46 public Tower
getTower() {
51 * Returns true if there is no Tower on this square.
53 * @return true if there is no Tower on this square, false otherwise.
55 public boolean isAvailable() {
56 return this.available
;