|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsimulation_MVC_Basic.Model
public class Model
This interface encapsulates the definition of functionality for a data model for a game world. Such data models consist of a collection of ShapeSprites.
Field Summary | |
---|---|
static java.util.logging.Logger |
logger
|
Constructor Summary | |
---|---|
Model(java.awt.Dimension worldDimension)
|
Method Summary | |
---|---|
void |
addListener(ModelListener listener)
Add a listener to this model. |
void |
addRandomSprite()
This method adds a sprite to this model. |
void |
addTubularSprite()
This method adds a sprite to this model. |
void |
advanceNextState()
Updates the data model to reflect whatever actions occur in the duration of one new frame. |
void |
drawCurrentState(java.awt.Graphics2D graphics)
|
java.awt.Dimension |
getWorldDimension()
|
boolean |
hasSprites()
Returns whether the game world has sprites in it. |
void |
moveAllSpritesToCentre()
|
void |
notifyModelHasChanged()
|
void |
removeSprite()
This method removes one sprite from the game world model. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.util.logging.Logger logger
Constructor Detail |
---|
public Model(java.awt.Dimension worldDimension)
Method Detail |
---|
public java.awt.Dimension getWorldDimension()
public void advanceNextState()
public void addListener(ModelListener listener)
listener
- public void notifyModelHasChanged()
public void drawCurrentState(java.awt.Graphics2D graphics)
public void addRandomSprite()
public void addTubularSprite()
public void removeSprite()
public boolean hasSprites()
public void moveAllSpritesToCentre()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |