Class frog.LiveState


class LiveState
extends frog.AFrogState


Variable Index

 o Singleton
Singleton instance of this class

Constructor Index

 o LiveState ()
Private constructor this class, hidden by use of singleton pattern

Method Index

 o getColor (Frog)
Accessor method for the color of the frog
 o getHit (Frog)
Hits the frog
 o moveBy (Frog, Point)
Move request to move the frog by translating the given amount

Variables

 o Singleton

static final LiveState Singleton = new LiveState()

Singleton instance of this class.

Constructors

 o LiveState

private  LiveState()

Private constructor this class, hidden by use of singleton pattern.

Methods

 o getColor

Color getColor(Frog context)

Accessor method for the color of the frog.

Parameters:
context - The context of this state.
Returns:
Color.GREEN always.
 o moveBy

Point moveBy(Frog context, Point delta)

Move request to move the frog by translating the given amount.

Parameters:
context - The context of this state.
Returns:
The new position of the frog.
 o getHit

IFrog getHit(Frog context)

Hits the frog. The frog will enter the dead state.

Parameters:
context - The context of this state.
Returns:
The frog.