|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object group1.model.gameobject.GameObjFactory
public class GameObjFactory
A factory class to make a GameObj. Used by Environment. Please add to this class as you make GameObj's. (Add to the import statements and the createGameObj method.)
Uses the "factory" and "singleton" design patterns, as suggested by the TA. You can't actually use the constructor in this class. Use getInstance() instead.
Method Summary | |
---|---|
GameObj |
createGameObj(char typeCode,
double x,
double y)
Given an alphabetic type code, construct the corresponding type of game object. |
static GameObjFactory |
getInstance(PictureList[] p)
Get an instance of this class. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static GameObjFactory getInstance(PictureList[] p)
public final GameObj createGameObj(char typeCode, double x, double y)
typeCode
- the alphabetic type code, or '.' to specify no object.x
- The x-coordinate position.y
- The y-coordinate position.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |