|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--de.uni_paderborn.robots.gui.CutScene
This class implements the CutScenes for important events. At the moment, there are
five different CutScenes:
| Inner Class Summary | |
private class |
CutScene.Animation
class to control the animation. |
private class |
CutScene.Controller
The inner class Controller represents a JFrame where you can activate or deactivate the CutScenes. |
private class |
CutScene.Drawing
This class contains the image that has to be drawn and it's ms, that is the time it will appear on screen. |
private class |
CutScene.Painting
The Painting is the component, where the sequence will be painted. |
| Field Summary | |
private CutScene.Animation |
anim
The current Animation object |
private boolean |
callFromGUI
indicating whether the CutScene has been evoked from the GUI |
private CutScene.Controller |
controller
The current Controller object |
private java.lang.String |
dirDisqualify
the directory for the images of the disqualified-robot |
private java.lang.String |
dirLeftCommon
the directory for the images of the robot on the left hand side |
private java.lang.String |
dirNoSwap
the directory for the images of the non-swapping-robot |
private java.lang.String |
dirOutOfEnergy
the directory for the images of the out-of-energy-robot |
private java.lang.String |
dirRightCommon
the directory for the images of the robot on the right hand side |
private java.lang.String |
dirRobot
the directory for the images of the robots in general |
private java.lang.String |
dirSwap
the directory for the images of the swapping-robot |
private java.lang.String |
dirVictory
the directory for the images of the victory-robot |
private static int |
DISQUALIFY
Parameter for getting the images of the DISQUALIFY scene. |
private static int |
NO_ENERGY
Parameter for getting the images of the SWAP scene. |
private static int |
NO_SWAP_LEFT
Parameter for getting the images of the SWAP scene. |
private static int |
NO_SWAP_RIGHT
Parameter for getting the images of the NO_SWAP scene. |
private CutScene.Painting |
painting
The current Painting object |
private java.util.Random |
rand
An instance of Random for the ranom()-method. |
private java.lang.String |
root
the root directory all images are in |
private static int |
SEE_STARS_LEFT
Parameter for getting the images of the SEE_STARS scene. |
private static int |
SEE_STARS_RIGHT
Parameter for getting the images of the SEE_STARS scene. |
private static int |
SWAP_LEFT
Parameter for getting the images of the SWAP scene. |
private static int |
SWAP_RIGHT
Parameter for getting the images of the SWAP scene. |
private static int |
VICTORY_PILLAR
Parameter for getting the images of the VICTORY scene. |
private static int |
VICTORY_ROBOT
Parameter for getting the images of the VITORY scene. |
| Constructor Summary | |
CutScene()
Creates a new instance of CutScenes. |
|
| Method Summary | |
void |
centerWindow(java.awt.Window window)
Method to center this window in the middle of the screen. |
void |
controller()
Method to activate the control window where you can enable or disable the CutScenes. |
private CutScene.Drawing[] |
createSequence(int robotID,
int kind)
Creates a new sequence that will be drawn. |
void |
disqualifyRobot(int robotID)
Use this method when a robot will be disqualified. |
boolean |
isDisqualifyActive()
Method to ensure that the CutScene when one robot has to be disqualified is set enabled. |
boolean |
isNoEnergyActive()
Method to ensure that the CutScene when one robot runs out of energy is set enabled. |
boolean |
isSwapBothActive()
Method to ensure that the CutScene when both robots want to swap cards is set enabled. |
boolean |
isSwapOneActive()
Method to ensure that the CutScene when only one robot wants to swap cards is set enabled. |
boolean |
isVictoryActive()
Method to ensure that the CutScene when one robot has one the game is set enabled. |
private int |
random(int bottom,
int top)
Convenience method for creating a random integer. |
void |
robotHasNoEnergy(int robotID)
Use this method when a robot has run out of energy. |
void |
setCallFromGUI(boolean b)
Method to set the callFromGUI variable that is needed to proove if the CutScene is called from the GUI. |
void |
swapBoth(int robot1,
int robot2)
Call this method when both robots wanna swap cards. |
void |
swapOne(int swapID,
int noSwapID)
Call this method when only one robot wann swap and the other don't. |
void |
victory(int robotID)
Use this method when a robot has won the game. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
private static final int SWAP_LEFT
private static final int SWAP_RIGHT
private static final int NO_SWAP_LEFT
private static final int NO_SWAP_RIGHT
private static final int DISQUALIFY
private static final int NO_ENERGY
private static final int SEE_STARS_LEFT
private static final int SEE_STARS_RIGHT
private static final int VICTORY_ROBOT
private static final int VICTORY_PILLAR
private CutScene.Animation anim
private CutScene.Controller controller
private CutScene.Painting painting
private boolean callFromGUI
private java.lang.String root
private java.lang.String dirLeftCommon
private java.lang.String dirRightCommon
private java.lang.String dirSwap
private java.lang.String dirNoSwap
private java.lang.String dirDisqualify
private java.lang.String dirOutOfEnergy
private java.lang.String dirRobot
private java.lang.String dirVictory
private java.util.Random rand
| Constructor Detail |
public CutScene()
| Method Detail |
private CutScene.Drawing[] createSequence(int robotID, int kind)
robotID - The ID of the robot as stored in RobotImages.kind - The kind of sequence. Use constants above.
public void swapBoth(int robot1,
int robot2)
robot1 - The ID of the robot on the one side in the CutScene.robot2 - The ID of the robot on the other side in the CutScene.
public void swapOne(int swapID,
int noSwapID)
swapID - The ID of the robot that wanna swap.noSwapID - The ID of the robot that don't wanna swap.public void disqualifyRobot(int robotID)
robotID - The ID of the robot that will be disqualified.public void robotHasNoEnergy(int robotID)
robotID - The ID of the robot that has run out of energy.public void victory(int robotID)
robotID - The ID of the robot that has run out of energy.public void controller()
private int random(int bottom,
int top)
bottom - The bottom-border of the integer (inclusive).top - The top-border of the integer (inclusive).bottom to the top.
if bottom is greater than the top, these two values will be swapped.public boolean isSwapBothActive()
true when the CutScene is set enabled
false otherwise.public boolean isSwapOneActive()
true when the CutScene is set enabled
false otherwise.public boolean isNoEnergyActive()
true when the CutScene is set enabled
false otherwise.public boolean isDisqualifyActive()
true when the CutScene is set enabled
false otherwise.public boolean isVictoryActive()
true when the CutScene is set enabled
false otherwise.public void setCallFromGUI(boolean b)
b - the boolean valuepublic void centerWindow(java.awt.Window window)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||