some refactoring
This commit is contained in:
parent
da3aef9704
commit
50ee753667
|
@ -29,23 +29,6 @@ public class TheGame implements StatemachineListener, GuiEventListener, IRCEvent
|
||||||
initGame();
|
initGame();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initGame() {
|
|
||||||
guiControl.addListener(this);
|
|
||||||
ircClient.addListener(this);
|
|
||||||
machine.addListener(this);
|
|
||||||
|
|
||||||
machine.reset();
|
|
||||||
relaisboard.open();
|
|
||||||
resetDomotics();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void rate(int rating, String text) {
|
|
||||||
gamerRating += rating;
|
|
||||||
ircClient.say("rated: " + rating + " (" + gamerRating + ") " + text);
|
|
||||||
if(gamerRating > 5) gamerRating = 5;
|
|
||||||
if(gamerRating < 1) gamerRating = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Event listener for state change events from statemachine
|
* Event listener for state change events from statemachine
|
||||||
* @param newState the new game state from statemachine
|
* @param newState the new game state from statemachine
|
||||||
|
@ -75,9 +58,6 @@ public class TheGame implements StatemachineListener, GuiEventListener, IRCEvent
|
||||||
mpdController.setVolume(50);
|
mpdController.setVolume(50);
|
||||||
mpdController.playSong("start", "mix");
|
mpdController.playSong("start", "mix");
|
||||||
|
|
||||||
bunti.setPar56(0,0,0);
|
|
||||||
bunti.setLampel(false,false,false);
|
|
||||||
|
|
||||||
guiControl.showCountDown(false);
|
guiControl.showCountDown(false);
|
||||||
break;
|
break;
|
||||||
case ENTERED_ROOM:
|
case ENTERED_ROOM:
|
||||||
|
@ -281,6 +261,23 @@ public class TheGame implements StatemachineListener, GuiEventListener, IRCEvent
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void initGame() {
|
||||||
|
guiControl.addListener(this);
|
||||||
|
ircClient.addListener(this);
|
||||||
|
machine.addListener(this);
|
||||||
|
|
||||||
|
machine.reset();
|
||||||
|
relaisboard.open();
|
||||||
|
resetDomotics();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void rate(int rating, String text) {
|
||||||
|
gamerRating += rating;
|
||||||
|
ircClient.say("rated: " + rating + " (" + gamerRating + ") " + text);
|
||||||
|
if(gamerRating > 5) gamerRating = 5;
|
||||||
|
if(gamerRating < 1) gamerRating = 1;
|
||||||
|
}
|
||||||
|
|
||||||
private void handleWallCommand(final String message) {
|
private void handleWallCommand(final String message) {
|
||||||
if(System.currentTimeMillis() - lastHandleWall < 7000 ) {
|
if(System.currentTimeMillis() - lastHandleWall < 7000 ) {
|
||||||
ircClient.say("not enough mana!");
|
ircClient.say("not enough mana!");
|
||||||
|
@ -448,6 +445,8 @@ public class TheGame implements StatemachineListener, GuiEventListener, IRCEvent
|
||||||
relaisboard.setRelais(6, true); // enable third green circle
|
relaisboard.setRelais(6, true); // enable third green circle
|
||||||
relaisboard.setRelais(2, false); // disable the lamp
|
relaisboard.setRelais(2, false); // disable the lamp
|
||||||
relaisboard.setRelais(3, false); // disable the oven
|
relaisboard.setRelais(3, false); // disable the oven
|
||||||
|
bunti.setPar56(0,0,0);
|
||||||
|
bunti.setLampel(false,false,false);
|
||||||
mpdController.clearPlaylist();
|
mpdController.clearPlaylist();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue