Class frog.DeadState


class DeadState
extends frog.AFrogState


Variable Index

 o Singleton
Singleton instance of this class

Constructor Index

 o DeadState ()
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--No effect

Variables

 o Singleton

static final DeadState Singleton = new DeadState()

Singleton instance of this class.

Constructors

 o DeadState

private  DeadState()

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

Methods

 o getColor

Color getColor(Frog host)

Accessor method for the color of the frog.

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

Point moveBy(Frog host, Point delta)

Move request to move the frog--No effect.

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

IFrog getHit(Frog host)

Hits the frog. No effect.

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