Class DataBase

java.lang.Object
  |
  +--InfoBase
        |
        +--DataBase

public class DataBase
extends InfoBase

Stores ALL of the information about the Locations and Questions of a Map


Field Summary
static int UNDEFINED
           
 
Constructor Summary
DataBase(int numQuestions)
           
 
Method Summary
 void addLocation(int x, int y, int[] answer, java.lang.String name, java.lang.String state, int labx, int laby)
          adds a location to the database listing
 chainMap copyMap()
          creats a copy of the borderMap (Which will be used for warping)
 QuizBase createQuiz(int numloc, int numQuizQuestions, boolean[] activequestions)
          creates and returns a quizbase object based on the number of locations and questions selected by the user
 void displayMap(java.awt.Graphics g)
          displays the border map
 java.lang.Object getNewLocation(java.util.ArrayList RandomList)
          gets a new unused random location
 int getrandom(int numlocations)
          returns a random number between 0 and numlocations
 void init()
          initializes the database so that all locations are available to be picked from
 void print()
           
 void printToFile()
           
 void setBorderColor(java.awt.Color c)
          sets the color of the border map to be displayed
 void setMap(chainMap map)
          sets the border map to be displayed
 void setNumLocations(int numLocations)
          sets the number of locations available for this map
 
Methods inherited from class InfoBase
addLocation, addQuestion, addQuestion, addQuestion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNDEFINED

public static final int UNDEFINED
Constructor Detail

DataBase

public DataBase(int numQuestions)
Method Detail

print

public void print()

printToFile

public void printToFile()

setMap

public void setMap(chainMap map)
sets the border map to be displayed

setNumLocations

public void setNumLocations(int numLocations)
sets the number of locations available for this map
Overrides:
setNumLocations in class InfoBase

init

public void init()
initializes the database so that all locations are available to be picked from

getrandom

public int getrandom(int numlocations)
returns a random number between 0 and numlocations

getNewLocation

public java.lang.Object getNewLocation(java.util.ArrayList RandomList)
gets a new unused random location

createQuiz

public QuizBase createQuiz(int numloc,
                           int numQuizQuestions,
                           boolean[] activequestions)
creates and returns a quizbase object based on the number of locations and questions selected by the user

addLocation

public void addLocation(int x,
                        int y,
                        int[] answer,
                        java.lang.String name,
                        java.lang.String state,
                        int labx,
                        int laby)
adds a location to the database listing

setBorderColor

public void setBorderColor(java.awt.Color c)
sets the color of the border map to be displayed

displayMap

public void displayMap(java.awt.Graphics g)
displays the border map

copyMap

public chainMap copyMap()
creats a copy of the borderMap (Which will be used for warping)