/* * Filename: SmallCastle.java * Created on September 16, 2005 * * ULID: mmgoodw * Course: ITK 168 * Sections: 7 and 10 * Instructor: Goodwin */ /** * @author Mary Goodwin * * This class creates a small castle for exercise 3.12 in Weber */ import becker.robots.*; public class SmallCastle extends City{ /**Construct a new small castle*/ public SmallCastle( ) { super(); this.placeTurret(1, 1); this.placeTurret(1, 4); this.placeTurret(4, 4); this.placeTurret(4, 1); this.placeCastleWalls(); } /**Create a turret for the castle * * @param street the street coordinate of the intersection the * turret surrounds * @param ave the avenue coordinate of the intersection the * turret surrounds */ private void placeTurret(int street, int ave) { Wall turretWall1 = new Wall(this, street, ave, Direction.EAST); Wall turretWall2 = new Wall(this, street, ave, Direction.WEST); Wall turretWall3 = new Wall(this, street, ave, Direction.SOUTH); Wall turretWall4 = new Wall(this, street, ave, Direction.NORTH); } /**Creates the main castle building*/ protected void placeCastleWalls() { Wall wall1 = new Wall(this, 2, 3, Direction.EAST); Wall wall2 = new Wall(this, 3, 3, Direction.EAST); Wall wall3 = new Wall(this, 3, 3, Direction.SOUTH); Wall wall4 = new Wall(this, 3, 2, Direction.SOUTH); Wall wall5 = new Wall(this, 3, 2, Direction.WEST); Wall wall6 = new Wall(this, 2, 2, Direction.WEST); Wall wall7 = new Wall(this, 2, 2, Direction.NORTH); Wall wall8 = new Wall(this, 2, 3, Direction.NORTH); } }