simulation_MVC_Basic
Class Model
java.lang.Object
simulation_MVC_Basic.Model
public class Model
- extends java.lang.Object
This interface encapsulates the definition of functionality for a data model
for a game world. Such data models consist of a collection of ShapeSprites.
- Author:
- mb
Field Summary |
static java.util.logging.Logger |
logger
|
Constructor Summary |
Model(java.awt.Dimension worldDimension)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
public static java.util.logging.Logger logger
Model
public Model(java.awt.Dimension worldDimension)
getWorldDimension
public java.awt.Dimension getWorldDimension()
advanceNextState
public void advanceNextState()
- Updates the data model to reflect whatever actions occur in the duration
of one new frame. Draws the game world on the passed Graphics2D instance.
addListener
public void addListener(ModelListener listener)
- Add a listener to this model.
- Parameters:
listener
-
notifyModelHasChanged
public void notifyModelHasChanged()
drawCurrentState
public void drawCurrentState(java.awt.Graphics2D graphics)
addAnotherSprite
public void addAnotherSprite()
removeSprite
public void removeSprite()