|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdarwin.domain.MyWorld
This class includes the functions necessary to keep track of the creatures in a two-dimensional world. In order for the design to be general, the class adopts the following design:
1. The contents are unspecified objects.
2. The dimensions of the world array are specified by the client.
There are many ways to implement this class. You should need to add no more than about ten lines of code to this file.
Constructor Summary | |
MyWorld(int aWidth,
int aHeight)
Create a new World consisting of aWidth columns and aHeight rows, each of which is numbered beginning at 0. |
Method Summary | |
java.lang.String |
toString()
Return a String representation of this World. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface darwin.domain.World |
get, getHeight, getWidth, inRange, set |
Constructor Detail |
public MyWorld(int aWidth, int aHeight)
aWidth
- the number of columns for this World.aHeight
- the number of rows for this World.Method Detail |
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |