com.jdwsoftware.wfh.model
Class ColorGame

java.lang.Object
  |
  +--com.jdwsoftware.wfh.model.GameType
        |
        +--com.jdwsoftware.wfh.model.ColorGame

public class ColorGame
extends GameType

Title: Woody's Fishing Hole

Description: Educational Fishing Game

Copyright: Copyright (C) 2003 JDW Software, LLC

Company: JDW Software, LLC

The simplest game, just match the colors

Version:
$Revision: 1.4 $
Author:
Jim Woodgate

Field Summary
 
Fields inherited from class com.jdwsoftware.wfh.model.GameType
_caller, BORDER, HEIGHT, WIDTH
 
Constructor Summary
ColorGame(javax.swing.JComponent caller)
           
 
Method Summary
 java.lang.String getAnswer()
          Get the string representation of the answer to getQuestion()
 java.awt.Image getAnswer(java.lang.String s)
          Given an answer string, get the corresponding image to put on the fish.
 java.awt.Image getQuestion()
          Get the question image this is to be displayed on the passed component
 java.lang.String[] getValidAnswers()
          Get a set of all possible answers.
 void newQuestion()
          Call new question to generate a new question and answer
 
Methods inherited from class com.jdwsoftware.wfh.model.GameType
getHeight, getWidth
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColorGame

public ColorGame(javax.swing.JComponent caller)
Method Detail

newQuestion

public void newQuestion()
Description copied from class: GameType
Call new question to generate a new question and answer

Specified by:
newQuestion in class GameType

getQuestion

public java.awt.Image getQuestion()
Description copied from class: GameType
Get the question image this is to be displayed on the passed component

Specified by:
getQuestion in class GameType
Returns:
an image of the question

getAnswer

public java.lang.String getAnswer()
Description copied from class: GameType
Get the string representation of the answer to getQuestion()

Specified by:
getAnswer in class GameType
Returns:
String answer

getValidAnswers

public java.lang.String[] getValidAnswers()
Description copied from class: GameType
Get a set of all possible answers. This is a set of string answers.

Specified by:
getValidAnswers in class GameType
Returns:
Set of all possible answers

getAnswer

public java.awt.Image getAnswer(java.lang.String s)
Description copied from class: GameType
Given an answer string, get the corresponding image to put on the fish.

Specified by:
getAnswer in class GameType
Parameters:
s - Answer
Returns:
Image for that answer