From 35d6c0e9b46204c1c97ced9e6f1416bd3bc3a731 Mon Sep 17 00:00:00 2001 From: Shlomi Fish Date: Wed, 31 Jul 2019 16:10:28 +0300 Subject: [PATCH] Extract a common class/struct. This is Refactoring / code cleanup. See: * https://en.wikipedia.org/wiki/God_object * https://en.wikipedia.org/wiki/Extract_class * https://en.wikipedia.org/wiki/Code_refactoring * https://www.refactoring.com/ * https://www.joelonsoftware.com/2002/01/23/rub-a-dub-dub/ Some small optimisations may have slipped in as well. --- pysollib/game/__init__.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/pysollib/game/__init__.py b/pysollib/game/__init__.py index acbb8f72..812516fb 100644 --- a/pysollib/game/__init__.py +++ b/pysollib/game/__init__.py @@ -567,14 +567,7 @@ class Game(object): # optional MfxCanvasText items self.texts = GameTexts() # initial position of the texts - self.init_texts = Struct( - info=None, # misc info text - help=None, # a static help text - misc=None, # - score=None, # for displaying the score - base_rank=None, # for displaying the base_rank - list=[], - ) + self.init_texts = GameTexts() def createPreview(self, app): old_busy = self.busy