/** * Class Tile - representation of a Tile to be placed on the floor * @author Your Names Here * Section ID */ // The following libraries are needed for graphics and for colors import uwcse.graphics.*; import java.awt.Color; public class Tile { // instance variables private int size; //Size of this square tile in pixels // you may decide to include more instance variables /** * Construct a new Tile with the given size and with a default color * of Color.black * @param tileSize - size of tile */ // replace this comment with your implementation of the 1-parameter constructor /** * Construct a new Tile with the given color and size * @param clientColor - The color of this Tile Object * @param tileSize - size of tile */ // replace this comment with your implementation of the 2-parameter constructor /** * Draw an image of this Tile on the floor at the given row and column * @param floor - Graphical window on to which the tile will be added * @param row - row number where the tile is to be added * @param col - col number where the tile is going to be added */ public void addTo(GWindow floor, int row, int col) { // implementation note: Draw your tile relative to point (0,0) [upper-left // corner of the window], then use method display (below) to move its Shapes // to the appropriate row and column on the tiled floor // replace this comment with your implementation of addTo } /** * Given a shape s whose coordinates are relative to (0,0), draw the shape * in the correct place on the floor so it is placed in the tile at the * given row and column. * @param floor - Graphical window on to which the shape will be added * @param s - the shape to be drawn * @param row - row number where the shape is going to be added * @param col - col number where the shape is going to be added */ private void display(GWindow floor, Shape s, int row, int col) { s.moveBy((col-1)*size,(row-1)*size); s.addTo(floor); } }