Javadoc, small bugfix in levels.xml
[AntiTD.git] / src / se / umu / cs / dit06ajnajs / level / TowerSquare.java
blob68d47c78654a47c9c33b4aaa40a3c1ea781acedf
1 package se.umu.cs.dit06ajnajs.level;
3 import java.awt.Image;
4 import se.umu.cs.dit06ajnajs.agent.Tower;
6 /**
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)
11 * @version 1.0
13 public class TowerSquare extends MapSquare {
15 private Tower tower;
16 private boolean available;
18 /**
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) {
27 super(x, y, img);
28 this.available = true;
31 /**
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) {
37 this.tower = tower;
38 available = false;
41 /**
42 * Returns the Tower on this square.
44 * @return The Tower on this square.
46 public Tower getTower() {
47 return this.tower;
50 /**
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;