public class HashWorld
extends java.lang.Object
implements uk.ac.cam.acr31.life.World
Constructor and Description |
---|
HashWorld(int width,
int height)
Create a new instance of HashWorld large enough to hold the dimensions
given.
|
Modifier and Type | Method and Description |
---|---|
void |
draw(java.awt.Graphics g,
int w,
int h) |
boolean |
getCell(int x,
int y) |
int |
getGeneration() |
int |
getHeight() |
int |
getPopulation() |
int |
getWidth() |
uk.ac.cam.acr31.life.World |
nextGeneration(int doubleSpeed) |
void |
print(java.io.Writer w)
print the World to the Writer given.
|
void |
setCell(int x,
int y,
boolean live) |
public HashWorld(int width, int height)
width
- height
- public void draw(java.awt.Graphics g, int w, int h)
draw
in interface uk.ac.cam.acr31.life.World
public void print(java.io.Writer w)
print
in interface uk.ac.cam.acr31.life.World
public int getPopulation()
getPopulation
in interface uk.ac.cam.acr31.life.World
public int getGeneration()
getGeneration
in interface uk.ac.cam.acr31.life.World
public boolean getCell(int x, int y)
getCell
in interface uk.ac.cam.acr31.life.World
public int getHeight()
getHeight
in interface uk.ac.cam.acr31.life.World
public int getWidth()
getWidth
in interface uk.ac.cam.acr31.life.World
public void setCell(int x, int y, boolean live)
setCell
in interface uk.ac.cam.acr31.life.World
public uk.ac.cam.acr31.life.World nextGeneration(int doubleSpeed)
nextGeneration
in interface uk.ac.cam.acr31.life.World