Block - public Block(int x, int y, Color c, Map m){...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
import java.awt.*; /** An instance of this class is a Block. Blocks cannot move.*/ public class Block extends Piece { /** Constructor: a new Block at position (x, y) on Map m with color white. */ public Block(int x, int y, int c, Map m){ super(Piece.BLOCK, m); setX(x); setY(y); if (c == 4){ setColor(Color.WHITE);} } /** Constructor: a new Block at position (x, y) on Map m with color c. Precondition: c is WHITE.*/
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: public Block(int x, int y, Color c, Map m){ super(Piece.BLOCK, m); setX(x); setY(y); setColor(Color.WHITE); } /** Block should not move. */ public void act(){ setActed(true); return; } /** = representation of this piece */ public String toString() { String color= ""; return " White Block at (" + getX() + ", " + getY() + ")"; } }...
View Full Document

This document was uploaded on 02/24/2010.

Ask a homework question - tutors are online