|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.jdwsoftware.wfh.model.GameType
Title: Woody's Fishing Hole
Description: Educational Fishing Game
Copyright: Copyright (C) 2003 JDW Software, LLC
Company: JDW Software, LLC
This is the abstract class that all the various game types extend. The basic premise is that a game has an answer which is shown near the top of the screen, and many questions. Each fish will get a question (and hopefully at least one fish will have the correct answer.. :)
For many games the questions and answers are the same (blue box to blue box or the number 8 to the number 8). However the MathGame will display a math problem for the question and numbers for the answers. Other things like pictures matching to words or upper case letters to lower case letters are easily added also.
Field Summary | |
protected javax.swing.JComponent |
_caller
|
protected static int |
BORDER
|
protected static int |
HEIGHT
|
protected static int |
WIDTH
|
Constructor Summary | |
GameType(javax.swing.JComponent caller)
Default constructor, note the component that is going to use this game needs to register itself so images can be created. |
Method Summary | |
abstract java.lang.String |
getAnswer()
Get the string representation of the answer to getQuestion() |
abstract java.awt.Image |
getAnswer(java.lang.String s)
Given an answer string, get the corresponding image to put on the fish. |
int |
getHeight()
In general the height of all the questions, because these will actually go on the fish, this method probably shouldn't be overriden unless you really know what you are doing. |
abstract java.awt.Image |
getQuestion()
Get the question image this is to be displayed on the passed component |
abstract java.lang.String[] |
getValidAnswers()
Get a set of all possible answers. |
int |
getWidth()
In general the width of all the questions, because these will actually go on the fish, this method probably shouldn't be overriden unless you really know what you are doing. |
abstract void |
newQuestion()
Call new question to generate a new question and answer |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected javax.swing.JComponent _caller
protected static final int WIDTH
protected static final int HEIGHT
protected static final int BORDER
Constructor Detail |
public GameType(javax.swing.JComponent caller)
caller
- Method Detail |
public int getWidth()
public int getHeight()
public abstract java.awt.Image getQuestion()
public abstract java.lang.String getAnswer()
public abstract java.lang.String[] getValidAnswers()
public abstract java.awt.Image getAnswer(java.lang.String s)
s
- Answer
public abstract void newQuestion()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |