Game of Life 1.5

org.bitstorm.gameoflife
Class ShapeCollection

java.lang.Object
  extended byorg.bitstorm.gameoflife.ShapeCollection

public class ShapeCollection
extends java.lang.Object

Contains some nice Game Of Life shapes.

Author:
Edwin Martin

Field Summary
private static Shape CELL10
           
private static Shape CLEAR
           
private static Shape[] COLLECTION
           
private static Shape EXPLODER
           
private static Shape FISH
           
private static Shape GLIDER
           
private static Shape PUMP
           
private static Shape SHOOTER
           
private static Shape SMALLEXPL
           
 
Constructor Summary
ShapeCollection()
           
 
Method Summary
static Shape getShapeByName(java.lang.String name)
          Get shape by its name.
static Shape[] getShapes()
          Get array of shapes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLEAR

private static final Shape CLEAR

GLIDER

private static final Shape GLIDER

SMALLEXPL

private static final Shape SMALLEXPL

EXPLODER

private static final Shape EXPLODER

CELL10

private static final Shape CELL10

FISH

private static final Shape FISH

PUMP

private static final Shape PUMP

SHOOTER

private static final Shape SHOOTER

COLLECTION

private static final Shape[] COLLECTION
Constructor Detail

ShapeCollection

public ShapeCollection()
Method Detail

getShapes

public static Shape[] getShapes()
Get array of shapes. It's not tamper-proof, but that's okay.

Returns:
collection of shapes

getShapeByName

public static Shape getShapeByName(java.lang.String name)
                            throws ShapeException
Get shape by its name.

Parameters:
name - name of shape
Returns:
shape object
Throws:
ShapeException - if no shape with this name exist

Game of Life 1.5

This API descibes the Game of Life program, written by Edwin Martin. The source code is available online too.

Copyright 1996-2004 Edwin Martin <edwin@bitstorm.org>.