Rewrite: Functionality to write content to special display
This commit is contained in:
@@ -6,3 +6,6 @@ class Display:
|
|||||||
|
|
||||||
def printScore(self, score):
|
def printScore(self, score):
|
||||||
networking.writeDisplayScore(self.name, score)
|
networking.writeDisplayScore(self.name, score)
|
||||||
|
|
||||||
|
def printContent(self, content):
|
||||||
|
networking.writeDisplayContent(self.name, content)
|
||||||
@@ -8,9 +8,9 @@ class SpecialDisplay(Display):
|
|||||||
self.ballsToPlay = 0
|
self.ballsToPlay = 0
|
||||||
|
|
||||||
def printScore(self):
|
def printScore(self):
|
||||||
super().printScore(int(str(self.credits).zfill(2)
|
super().printContent(str(self.credits).zfill(2)
|
||||||
+ str(self.gameTimeBonus).zfill(2)
|
+ str(self.gameTimeBonus).zfill(2)
|
||||||
+ str(self.ballsToPlay).zfill(2)))
|
+ str(self.ballsToPlay).zfill(2))
|
||||||
|
|
||||||
def printBallsToPlay(self, ballsToPlay):
|
def printBallsToPlay(self, ballsToPlay):
|
||||||
self.ballsToPlay = ballsToPlay
|
self.ballsToPlay = ballsToPlay
|
||||||
|
|||||||
@@ -7,14 +7,16 @@ from solenoids.MainFlipper import MainFlipper
|
|||||||
|
|
||||||
|
|
||||||
class StartBallEvent(Event):
|
class StartBallEvent(Event):
|
||||||
def __init__(self):
|
def __init__(self, gameState):
|
||||||
|
self.gameState = gameState
|
||||||
self.flipper = MainFlipper()
|
self.flipper = MainFlipper()
|
||||||
super().__init__("Start Ball Event")
|
super().__init__("Start Ball Event")
|
||||||
|
|
||||||
def trigger(self, target):
|
def trigger(self, target):
|
||||||
super().trigger(target)
|
super().trigger(target)
|
||||||
self.flipper.activate()
|
|
||||||
BottomRightBankSolenoid().trigger()
|
BottomRightBankSolenoid().trigger()
|
||||||
BottomLeftBankSolenoid().trigger()
|
BottomLeftBankSolenoid().trigger()
|
||||||
TopCentralBankSolenoid().trigger()
|
TopCentralBankSolenoid().trigger()
|
||||||
OutHoleSolenoid().trigger()
|
OutHoleSolenoid().trigger()
|
||||||
|
self.flipper.activate()
|
||||||
|
self.gameState.currentPlayer.activate()
|
||||||
|
|||||||
@@ -56,6 +56,9 @@ class Networking:
|
|||||||
def writeDisplayScore(self, display, score):
|
def writeDisplayScore(self, display, score):
|
||||||
self.get("/displays/" + display + "/write_score/" + str(score))
|
self.get("/displays/" + display + "/write_score/" + str(score))
|
||||||
|
|
||||||
|
def writeDisplayContent(self, display, content):
|
||||||
|
self.get("/displays/" + display + "/write_content/" + content)
|
||||||
|
|
||||||
async def getInputEvent(self):
|
async def getInputEvent(self):
|
||||||
header = list()
|
header = list()
|
||||||
while b'\x02' not in header:
|
while b'\x02' not in header:
|
||||||
|
|||||||
Reference in New Issue
Block a user