fr.umlv.platform
Interface GameModel<S>

Type Parameters:
S - type of the sprites managed by this game model.

public interface GameModel<S>

Define a model associated to a game. Provide functions called by GameScene.


Method Summary
Modifier and Type Method and Description
 void applyKeyHandledSprites(Function<? super S> function, long when)
          Calls function.fun() on any sprites of type S which should be drawn on the game zone
 void applyParallaxInZone(Function<? super S> function, int x, int y, int width, int height)
          Calls function.fun() on any parallax of type S which should be drawn on the zone defined by x, y, width, height
 void applyPatternsInZone(Function<? super S> function, int x, int y, int width, int height)
          Calls function.fun() on any patterns of type S which should be drawn on the zone defined by x, y, width, height
 java.awt.Image getImage(S sprite)
          Returns the image of a given sprite.
 java.awt.Point getLocation(S sprite)
          Returns the location of a given sprite as a point.
 

Method Detail

applyParallaxInZone

void applyParallaxInZone(Function<? super S> function,
                         int x,
                         int y,
                         int width,
                         int height)
Calls function.fun() on any parallax of type S which should be drawn on the zone defined by x, y, width, height

Parameters:
function -
x - x of the zone to draw
y - y of the zone to draw
width - width of the zone to draw
height - height of the zone to draw

applyPatternsInZone

void applyPatternsInZone(Function<? super S> function,
                         int x,
                         int y,
                         int width,
                         int height)
Calls function.fun() on any patterns of type S which should be drawn on the zone defined by x, y, width, height

Parameters:
function -
x -
y -
width -
height -

applyKeyHandledSprites

void applyKeyHandledSprites(Function<? super S> function,
                            long when)
Calls function.fun() on any sprites of type S which should be drawn on the game zone

Parameters:
when -
function -

getLocation

java.awt.Point getLocation(S sprite)
Returns the location of a given sprite as a point.

Parameters:
sprite - the sprite.
Returns:
the location of a given sprite as a point.

getImage

java.awt.Image getImage(S sprite)
Returns the image of a given sprite.

Parameters:
sprite - the sprite.
Returns:
the image of a given sprite.