|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcz.cvut.agents.rph.reversi.main.HeadlessReversiCreator
cz.cvut.agents.rph.reversi.main.ReversiCreator
public class ReversiCreator
Creator of the Reversi game. Main entry point of the game. Author: Ondrej Vanek Date: 10/3/12 Time: 10:09 AM
Field Summary | |
---|---|
protected static int |
FRAME_HEIGHT
Height of the JFrame holding the ReversiView . |
protected static int |
FRAME_WIDTH
Width of the JFrame holding the ReversiView . |
protected ReversiView |
view
View of the game |
Fields inherited from class cz.cvut.agents.rph.reversi.main.HeadlessReversiCreator |
---|
controller, model, PLAYGROUND_HEIGHT, PLAYGROUND_WIDTH, timeoutInMilis |
Constructor Summary | |
---|---|
ReversiCreator()
|
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
For restarting purposes. |
protected ReversiController |
createGame(int width,
int height,
ReversiPlayer player1,
ReversiPlayer player2)
Creates the whole game. |
static void |
main(java.lang.String[] args)
Creates a Reversi game. |
private ReversiGameResult |
playGame()
Calls the controller with to execute the game. |
private void |
setLookAndFeel()
Sets nicer look&feel (Nimbus - works from Java 6.10 further). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final int FRAME_WIDTH
ReversiView
.
protected static final int FRAME_HEIGHT
ReversiView
.
protected ReversiView view
Constructor Detail |
---|
public ReversiCreator()
Method Detail |
---|
public static void main(java.lang.String[] args) throws java.lang.Exception
args
- full names of the player classes (e.g. cz.cvut.agents.rph.reversi.players.WrongMovePlayer) and size of the board (all optional).
java.lang.Exception
protected ReversiController createGame(int width, int height, ReversiPlayer player1, ReversiPlayer player2) throws java.lang.Exception
createGame
in class HeadlessReversiCreator
width
- width of the playground.height
- height of the playground.player1
- first player.player2
- second player.
java.lang.Exception
- if something goes wrong, inspect this guy.private ReversiGameResult playGame() throws java.lang.Exception
java.lang.Exception
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
e
- event (from the ReversiView
.private void setLookAndFeel()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |