From bc5bdf6fa4c0a13ad7ebe23d72541e27a34a741f Mon Sep 17 00:00:00 2001 From: Makrellka Date: Thu, 26 May 2022 19:27:40 +0200 Subject: [PATCH] fix --- util/PathByEnum.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/util/PathByEnum.py b/util/PathByEnum.py index ac22fa3..efe2cee 100644 --- a/util/PathByEnum.py +++ b/util/PathByEnum.py @@ -1,14 +1,16 @@ from random import random +from data.enum.ItemType import ItemType + class PathByEnum: - def get_random_path(self, item): - if item == 1: + def get_random_path(self, item:ItemType): + if item == ItemType.DOOR: a = str(random.randint(1, 10)) return "item_images/door/drzwi" + a + ".jpg" - if item == 2: + if item == ItemType.EGG: a = str(random.randint(1, 10)) return "item_images/refrigerator/lodowka" + a + ".jpg" - if item == 3: + if item == ItemType.SHELF: a = str(random.randint(1, 10)) return "item_images/shelf/polka" + a + ".jpg"