Remove singelton fix bugs

This commit is contained in:
Jonas Zeunert
2021-03-07 16:33:12 +01:00
parent 62bdd68c5a
commit 84aeec895a
5 changed files with 6 additions and 5 deletions

View File

@@ -221,6 +221,7 @@ class PlayerState:
def updatePlayfieldTime(self):
if self.upperPlayfieldTime == 0:
self.upperPlayfieldTimer = None
LeaveUpperPlayfieldEvent(self, )
return
if self.upperPlayfieldTime in [0, 5, 10, 20]:

View File

@@ -1,13 +1,13 @@
networking = None
import argparse
import config
from factories.NetworkFactory import NetworkFactory
from factories.GameFactory import GameFactory
import asyncio
import logging
networking = None
def main():
args = parseCommandLine()
@@ -36,6 +36,7 @@ def createGame(args):
print(args)
global networking
networking = NetworkFactory.createNetwork(args.OutputServerAddress, args.InputServerAddress)
from factories.GameFactory import GameFactory
game = GameFactory().createGame()
return game

View File

@@ -3,7 +3,7 @@ from solenoids.TopFlipper import TopFlipper
class LeaveUpperPlayfieldEvent(Event):
def __init__(self, playerState, flipper):
def __init__(self, playerState):
self.playerState = playerState
self.flipper = TopFlipper()
super().__init__("Leave Upper Playfield Event")

View File

@@ -8,7 +8,7 @@ class Lamp:
networking.activateLamp(self)
def deactivate(self):
networking.deactivateLamp()
networking.deactivateLamp(self)
def isActivated(self):
networking.getLamps(self)

View File

@@ -1,7 +1,6 @@
import requests_unixsocket as req
import socket
import json
import asyncio
class Networking: