From 4fbf9f91fcaa8e5aaf37b09f740e8ad9936825f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Ple=C3=9F?= Date: Fri, 8 Jun 2012 03:47:59 +0200 Subject: [PATCH] added relay to suppress light barrier and third circle contact when not needed --- src/de/ctdo/crashtest/game/TheGame.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/de/ctdo/crashtest/game/TheGame.java b/src/de/ctdo/crashtest/game/TheGame.java index e9dcdf1..21b8b94 100644 --- a/src/de/ctdo/crashtest/game/TheGame.java +++ b/src/de/ctdo/crashtest/game/TheGame.java @@ -34,7 +34,7 @@ public class TheGame implements StatemachineListener, GuiEventListener, IRCEvent machine.reset(); relaisboard.open(); - relaisboard.toggleRelais(2, 2000); + resetDomotics(); } private void rate(int rating, String text) { @@ -58,6 +58,8 @@ public class TheGame implements StatemachineListener, GuiEventListener, IRCEvent case IDLE: gamerRating = 3; machine.stopTimer(); + resetDomotics(); + guiControl.setExtra(""); guiControl.setWall(""); @@ -70,6 +72,7 @@ public class TheGame implements StatemachineListener, GuiEventListener, IRCEvent guiControl.showCountDown(false); break; case ENTERED_ROOM: + relaisboard.setRelais(7, false); // disable light barrier over relais mpdController.setVolume(70); mpdController.playSong("tidirium", "welcome"); @@ -82,6 +85,7 @@ public class TheGame implements StatemachineListener, GuiEventListener, IRCEvent machine.startTimer(60*8); break; case TABLE_GAME_ONE: + relaisboard.setRelais(6, true); // enable third green circle guiControl.setWall("64K RAM SYSTEM 38911 BASIC BYTES FREE. **** COMMODORE 64 BASIC V2 ****"); mpdController.setVolume(70); @@ -148,6 +152,7 @@ public class TheGame implements StatemachineListener, GuiEventListener, IRCEvent sayScore(); + relaisboard.setRelais(6, false); // disable third green circle relaisboard.blinkRelais(2, 700, 6); // hint Button break; @@ -383,5 +388,10 @@ public class TheGame implements StatemachineListener, GuiEventListener, IRCEvent } + private void resetDomotics() { + relaisboard.toggleRelais(2, 2000); + relaisboard.setRelais(7, true); // enable light barrier over relais + relaisboard.setRelais(6, true); // enable third green circle + } }