|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Observable
gizmoball.gui.GamePlayModel
public class GamePlayModel
Nested Class Summary | |
---|---|
static class |
GamePlayModel.GameMode
These values are the different modes the game can be in. |
Field Summary | |
---|---|
double |
CAMERA_AMOUNT
Increment of camera movement. |
int |
cameraPositionLimit
The maximum allowed value of cameraPosition. |
java.lang.String |
currentDirectory
The most recent file directory that was used to load / save. |
java.lang.String |
titleMessage
|
Method Summary | |
---|---|
void |
addKeyForGizmo(java.lang.Integer key,
Gizmo giz)
Adds link between specified key and specified Gizmo. |
void |
addToKeyDown(java.lang.Integer key)
Adds key to keyDown. |
void |
changeCameraPosition(int index,
int dir)
|
void |
changeKeyForGameObject(java.lang.Integer key,
GameObject go)
This function links a key to a GameObject if no such link exists. |
void |
clearActives()
Clear gizmos and triggers. |
GameObject |
closest(Vect3 initPos,
Vect3 dir)
|
void |
doKeyMapping(java.lang.Integer ke)
Runs the UserActions mapped by ke. |
void |
edit()
Changes back and forth between edit mode and play paused mode. |
void |
endDialog()
Returns game mode to a previous mode upon end of dialog. |
void |
errorMessage(java.lang.String message)
Notifies user of error. |
void |
escape()
Either quit or exits to main menu. |
boolean |
findOutYesNo(java.lang.String message)
Asks user whether he wants to do a certain action. |
Vect3 |
getCameraCoordinates()
|
Vect3 |
getCameraLookAt()
Returns the point at which the camera is looking. |
Vect3 |
getCameraPosition()
Gets the current position of the camera (ignoring any transitory effects that the worlddrawer does) |
int |
getCameraPosition(int index)
|
java.util.List<java.lang.Integer> |
getDownKeysForGameObject(GameObject g)
Returns all keys (key down) associated to activate g. |
int |
getFrameRate()
|
GamePlayModel.GameMode |
getGameMode()
|
java.util.List<Gizmo> |
getGizmosForKey(java.lang.Integer ke)
Returns all Gizmos activated by key. |
java.util.Set<java.lang.Integer> |
getKeyDown()
|
java.util.List<java.lang.Integer> |
getKeysForGameObject(GameObject g)
Returns all keys associated to activate g. |
boolean |
getShowWireframe()
|
java.util.List<java.lang.Integer> |
getUpKeysForGameObject(GameObject g)
Returns all keys (key up) associated to activate g. |
WorldModel |
getWorldModel()
|
boolean |
hasKeyForGizmo(java.lang.Integer key,
Gizmo giz)
Returns t |
void |
init()
Prepares to start game and shows the welcome screen. |
boolean |
isXMLFile(java.io.File file)
|
java.util.Set<java.lang.Integer> |
keySet()
Returns the key set of the key mapping. |
void |
load()
Brings up a JFileChooser. |
void |
loadFromFile(java.io.File filename)
Loads from file named filename. |
void |
loadKeyMappingsFromWorldModel()
Loads key-to-action assignments from loaded WorldModel wm. |
void |
loadWM(WorldModel wm)
Loads WorldModel. |
void |
newGame()
Loads a default WorldModel. |
void |
pause()
Pauses the game if unpaused, unpauses the game otherwise. |
void |
quit()
Calls quit(true). |
void |
quit(boolean ask)
|
void |
removeFromKeyDown(java.lang.Integer key)
Removes key from keyDown. |
void |
removeKeyForGizmo(java.lang.Integer key,
Gizmo go)
Removes the link between specified key and specified Gizmo. |
void |
removeKeysForGizmo(Gizmo go)
Removes all keys linked to specified Gizmo. |
void |
resetCameraPosition()
Resets cameraPosition. |
void |
resetKeyPushNano()
Resets counter for repushing keys. |
void |
resetWM()
Resets wm, gr, default key mappings, and the list of Gizmos to activate. |
void |
runGame()
Runs game. |
void |
save()
Saves to currentFile if it exists. |
void |
saveAs()
Brings up a JFileChooser. |
void |
saveToFile(java.io.File filename)
Saves WorldModel contents to filename. |
void |
setCamera(Vect3 camera)
Sets camera to the argument. |
void |
setCameraLookAt(Vect3 newLookAt)
Sets camera's look to argument. |
void |
setFrameRate(int framerate)
|
void |
setKeyMappingsToWorldModel()
Sends the current key-to-actions mapping to the current WorldModel wm. |
void |
setMessage(java.lang.String msg)
Sets title message. |
void |
setWalls()
Sets currentWalls. |
void |
startDialog()
Saves current mode and pauses game in preparation for a dialog box. |
void |
stopCamera()
Confirms camera movement. |
void |
translateCamera(Vect3 translate)
Translates camera by the argument. |
void |
updateCurrentFile(java.io.File filename)
Updates currentFile and currentDirectory so that they reflect the most recent file and directory that was saved/loaded. |
boolean |
updateScreen()
Notifies of whether game screen needs to be updated. |
double |
updatingInterval()
|
void |
welcome()
Opens welcome screen. |
void |
wireframe()
Shows / hides wireframe. |
Methods inherited from class java.util.Observable |
---|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public java.lang.String titleMessage
public final int cameraPositionLimit
public final double CAMERA_AMOUNT
public java.lang.String currentDirectory
Method Detail |
---|
public void init()
public java.util.Set<java.lang.Integer> keySet()
public java.util.List<java.lang.Integer> getDownKeysForGameObject(GameObject g)
g
-
public java.util.List<Gizmo> getGizmosForKey(java.lang.Integer ke)
ke
-
public java.util.List<java.lang.Integer> getKeysForGameObject(GameObject g)
g
-
public java.util.List<java.lang.Integer> getUpKeysForGameObject(GameObject g)
g
-
public void changeKeyForGameObject(java.lang.Integer key, GameObject go)
key
- go
- public void removeKeysForGizmo(Gizmo go)
go
- public void removeKeyForGizmo(java.lang.Integer key, Gizmo go)
go
- public void addKeyForGizmo(java.lang.Integer key, Gizmo giz)
go
- public boolean hasKeyForGizmo(java.lang.Integer key, Gizmo giz)
key
- giz
-
public void doKeyMapping(java.lang.Integer ke)
ke
- public void stopCamera()
public Vect3 getCameraPosition()
CameraChanger
getCameraPosition
in interface CameraChanger
public void resetCameraPosition()
public int getCameraPosition(int index)
public void changeCameraPosition(int index, int dir)
public void translateCamera(Vect3 translate)
translateCamera
in interface CameraChanger
translate
- public void setCamera(Vect3 camera)
setCamera
in interface CameraChanger
camera
- public void setCameraLookAt(Vect3 newLookAt)
setCameraLookAt
in interface CameraChanger
newLookAt
- public Vect3 getCameraCoordinates()
public Vect3 getCameraLookAt()
getCameraLookAt
in interface CameraChanger
public void setFrameRate(int framerate)
framerate
- public int getFrameRate()
public java.util.Set<java.lang.Integer> getKeyDown()
public void addToKeyDown(java.lang.Integer key)
key
- public void removeFromKeyDown(java.lang.Integer key)
key
- public GamePlayModel.GameMode getGameMode()
public boolean updateScreen()
public WorldModel getWorldModel()
public void runGame()
public void resetKeyPushNano()
public void welcome()
public void escape()
public void quit()
void quit(boolean ask)
public void quit(boolean ask)
ask
- Exits the application. Asks user for confirmation if and only
if ask is true.public boolean findOutYesNo(java.lang.String message)
public void startDialog()
public void endDialog()
public void errorMessage(java.lang.String message)
public void wireframe()
public boolean getShowWireframe()
public void pause()
public void edit()
public boolean isXMLFile(java.io.File file)
file
-
public void save()
public void saveAs()
public void saveToFile(java.io.File filename)
filename
- public void newGame()
public void load()
public void loadFromFile(java.io.File filename)
filename
- public void updateCurrentFile(java.io.File filename)
filename
- public void loadWM(WorldModel wm)
this.wm
- public void setMessage(java.lang.String msg)
msg
- public void setWalls()
public void loadKeyMappingsFromWorldModel()
public void setKeyMappingsToWorldModel()
public void resetWM()
wm
- public void clearActives()
public double updatingInterval()
public GameObject closest(Vect3 initPos, Vect3 dir)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |