/* * AP(r) Computer Science GridWorld Case Study: * Copyright(c) 2005-2006 Cay S. Horstmann (http://horstmann.com) * * This code is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation. * * This code is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * @author Cay Horstmann * @author Chris Nevison * @author Barbara Cloud Wells */ import info.gridworld.actor.Bug; /** * A PatternBug used to create patterns like a box * or a spiral or circle */ public abstract class PatternBug extends Bug { private int steps; private int sideLength; /** * Constructs a PatternBug that has a side length * @param length the side length */ public PatternBug(int length) { steps = 0; sideLength = length; } /** * Method to return the value of steps * @return the current number of steps */ public int getSteps() { return steps; } /** * Method to set the number of steps * @param value the value to use */ public void setSteps(int value) { steps = value; } /** * Method to get the side length * @return the length of the side - 1 */ public int getSideLength() { return sideLength; } public void setSideLength(int len) { sideLength = len; } }