Field - /* * To change this template, choose Tools |...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package minesweeper; /** * * @author lloydwilkerson */ public class Field { /** * The "mine" variable is * false if the field is safe, * true if the field contains a mine. */ private boolean mine; /** * The content of a field can be a. .. * "?" - indicating an unknown field * "F" - a flagged field * "M" - a mine * a number ranging from 0 to 8 - indicating the number of surrounding mines */ private String content; /** * The integer "neighbours" indicates the number of surrounding mines. */ private int neighbours; /** * Field constructor. * Every Field initially contains no mine. * It's up to the Minefield class to allocate a certain number of fields mines. * The content is initially unknown. * * @post The mine attribute is set to false. | new.getMine() == false * @post The content is set to unknown ("?"). | new.getContent().equals("?") * @post The Field initially has no neighbours, so neighbours is set to 0. | new.getNeighbours() == 0
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

Field - /* * To change this template, choose Tools |...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online