/* * Filename: BigCastle.java * Created on September 16, 2005 * * ULID: mmgoodw * Course: ITK 168 * Sections: 7 and 10 * Instructor: Goodwin */ /** * @author Mary Goodwin * * This class creates a big castle for exercise 3.13 in Weber */ import becker.robots.*; public class BigCastle extends City{ /**Construct a new big castle*/ public BigCastle() { super(); this.placeTurret(1, 1); this.placeTurret(1, 5); this.placeTurret(5, 5); this.placeTurret(5, 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, 2, Direction.NORTH); Wall wall2 = new Wall(this, 2, 3, Direction.NORTH); Wall wall3 = new Wall(this, 2, 4, Direction.NORTH); Wall wall4 = new Wall(this, 2, 4, Direction.EAST); Wall wall5 = new Wall(this, 3, 4, Direction.EAST); Wall wall6 = new Wall(this, 4, 4, Direction.EAST); Wall wall7 = new Wall(this, 4, 4, Direction.SOUTH); Wall wall8 = new Wall(this, 4, 3, Direction.SOUTH); Wall wall9 = new Wall(this, 4, 2, Direction.SOUTH); Wall wall10 = new Wall(this, 4, 2, Direction.WEST); Wall wall11 = new Wall(this, 3, 2, Direction.WEST); Wall wall12 = new Wall(this, 2, 2, Direction.WEST); } }