Remove singelton fix bugs
This commit is contained in:
@@ -221,6 +221,7 @@ class PlayerState:
|
|||||||
def updatePlayfieldTime(self):
|
def updatePlayfieldTime(self):
|
||||||
if self.upperPlayfieldTime == 0:
|
if self.upperPlayfieldTime == 0:
|
||||||
self.upperPlayfieldTimer = None
|
self.upperPlayfieldTimer = None
|
||||||
|
LeaveUpperPlayfieldEvent(self, )
|
||||||
return
|
return
|
||||||
|
|
||||||
if self.upperPlayfieldTime in [0, 5, 10, 20]:
|
if self.upperPlayfieldTime in [0, 5, 10, 20]:
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
|
networking = None
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import config
|
import config
|
||||||
|
|
||||||
from factories.NetworkFactory import NetworkFactory
|
from factories.NetworkFactory import NetworkFactory
|
||||||
from factories.GameFactory import GameFactory
|
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
networking = None
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
args = parseCommandLine()
|
args = parseCommandLine()
|
||||||
@@ -36,6 +36,7 @@ def createGame(args):
|
|||||||
print(args)
|
print(args)
|
||||||
global networking
|
global networking
|
||||||
networking = NetworkFactory.createNetwork(args.OutputServerAddress, args.InputServerAddress)
|
networking = NetworkFactory.createNetwork(args.OutputServerAddress, args.InputServerAddress)
|
||||||
|
from factories.GameFactory import GameFactory
|
||||||
game = GameFactory().createGame()
|
game = GameFactory().createGame()
|
||||||
return game
|
return game
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ from solenoids.TopFlipper import TopFlipper
|
|||||||
|
|
||||||
|
|
||||||
class LeaveUpperPlayfieldEvent(Event):
|
class LeaveUpperPlayfieldEvent(Event):
|
||||||
def __init__(self, playerState, flipper):
|
def __init__(self, playerState):
|
||||||
self.playerState = playerState
|
self.playerState = playerState
|
||||||
self.flipper = TopFlipper()
|
self.flipper = TopFlipper()
|
||||||
super().__init__("Leave Upper Playfield Event")
|
super().__init__("Leave Upper Playfield Event")
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ class Lamp:
|
|||||||
networking.activateLamp(self)
|
networking.activateLamp(self)
|
||||||
|
|
||||||
def deactivate(self):
|
def deactivate(self):
|
||||||
networking.deactivateLamp()
|
networking.deactivateLamp(self)
|
||||||
|
|
||||||
def isActivated(self):
|
def isActivated(self):
|
||||||
networking.getLamps(self)
|
networking.getLamps(self)
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import requests_unixsocket as req
|
import requests_unixsocket as req
|
||||||
import socket
|
import socket
|
||||||
import json
|
import json
|
||||||
import asyncio
|
|
||||||
|
|
||||||
|
|
||||||
class Networking:
|
class Networking:
|
||||||
|
|||||||
Reference in New Issue
Block a user