Class Marker

java.lang.Object
  |
  +--CellDweller
        |
        +--Marker

public class Marker
extends CellDweller

A Marker is a type of CellDweller. A marker is a flag or question mark placed by the player on a particular Cell. There can only be one Marker on each Cell at a time.

Author:
Phil Reakes

Field Summary
(package private) static Color FLAG
           
(package private) static Color QUESTION_MARK
           
 
Fields inherited from class CellDweller
parentCell
 
Constructor Summary
Marker(Cell cell)
          Constructor for Markers.
 
Method Summary
 void cycle()
          Cycles the marker between flag, question mark, and nothing.
 Color getType()
          Get the Color representing the 'type' of this marker -- flag or question mark.
 void setType(Color type)
          Set the 'type' of this marker -- flag or question mark, and paint its colour on the parent cell.
 void updateFlagCounters()
          Update World's flag counters to keep score accurate.
 
Methods inherited from class CellDweller
getCell, setCell
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FLAG

static final Color FLAG

QUESTION_MARK

static final Color QUESTION_MARK
Constructor Detail

Marker

public Marker(Cell cell)
Constructor for Markers. Places the marker on a specified Cell. When constructed, a Marker defaults to the flag type.

Parameters:
cell - the Cell on which this marker is to be placed.
Method Detail

cycle

public void cycle()
Cycles the marker between flag, question mark, and nothing.


getType

public Color getType()
Get the Color representing the 'type' of this marker -- flag or question mark.

Returns:
the 'type' of the marker

setType

public void setType(Color type)
Set the 'type' of this marker -- flag or question mark, and paint its colour on the parent cell.

Parameters:
type - the 'type' of the marker

updateFlagCounters

public void updateFlagCounters()
Update World's flag counters to keep score accurate.



Generated by BlueJ