|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.htwdd.rosenkoenig.neuro.PatternCreator
public class PatternCreator
This class implements the interface GameObserver in order to create output that the net later on can be fed with.
| Field Summary | |
|---|---|
private int |
card
This integer represents the number of the card played. |
private java.io.PrintStream |
currentStream
Guessing by the name I'd suggest this is the PrintStream of the currenly active player. |
private java.lang.String |
directory
Internal variable used to store the directory the files containing the net feed. |
private boolean |
drawCard
This boolean persists the state of the drawCard stack. |
private Game |
game
A reference the game we're observing. |
private boolean |
knight
This boolean persists the state of the knights. |
private org.apache.log4j.Logger |
log
The logging facility. |
private java.util.EnumMap<Color,java.io.PrintStream> |
printStreams
Enumeration containing the PrintStreams of the feeds for the two players. |
| Constructor Summary | |
|---|---|
PatternCreator(Game game,
java.lang.String directory)
Ctor. |
|
| Method Summary | |
|---|---|
void |
cardSelected()
Remember the index of the card the player selected. |
void |
drawDeckSelected()
Persist that user selected the drawCards deck and set the played card to -1 (no card played). |
void |
gameEnded()
On end of the game simply close all open PrintStreams. |
void |
gameStarted()
At the beginning of the game we must create a PrintStream for both players. |
void |
knightsToggled()
Toggle the knight status. |
void |
turnEnded()
When the player ended their turn, we can write the result of the move. |
void |
turnStarted()
Turn started sets currentStream to the active player, initilizes card and drawCard and writes the board information to this file. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private java.lang.String directory
private java.util.EnumMap<Color,java.io.PrintStream> printStreams
private java.io.PrintStream currentStream
private Game game
private boolean knight
private boolean drawCard
private int card
private org.apache.log4j.Logger log
| Constructor Detail |
|---|
public PatternCreator(Game game,
java.lang.String directory)
game - a reference to the game to be observed.directory - the directory that is supposed to contain
the feeds| Method Detail |
|---|
public void drawDeckSelected()
drawDeckSelected in interface GameObserverpublic void cardSelected()
cardSelected in interface GameObserverpublic void gameEnded()
gameEnded in interface GameObserverpublic void gameStarted()
gameStarted in interface GameObserverpublic void knightsToggled()
knightsToggled in interface GameObserverpublic void turnStarted()
turnStarted in interface GameObserverpublic void turnEnded()
turnEnded in interface GameObserver
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||