From bf4d4aaeaa937e6a70c6045bcc67063f6c0033fd Mon Sep 17 00:00:00 2001 From: Makrellka Date: Thu, 26 May 2022 19:22:51 +0200 Subject: [PATCH] pathByEnum util added --- item_images/door/{drzwi2.png => drzwi2.jpg} | Bin util/PathByEnum.py | 14 ++++++++++++++ 2 files changed, 14 insertions(+) rename item_images/door/{drzwi2.png => drzwi2.jpg} (100%) create mode 100644 util/PathByEnum.py diff --git a/item_images/door/drzwi2.png b/item_images/door/drzwi2.jpg similarity index 100% rename from item_images/door/drzwi2.png rename to item_images/door/drzwi2.jpg diff --git a/util/PathByEnum.py b/util/PathByEnum.py new file mode 100644 index 0000000..ac22fa3 --- /dev/null +++ b/util/PathByEnum.py @@ -0,0 +1,14 @@ +from random import random + + +class PathByEnum: + def get_random_path(self, item): + if item == 1: + a = str(random.randint(1, 10)) + return "item_images/door/drzwi" + a + ".jpg" + if item == 2: + a = str(random.randint(1, 10)) + return "item_images/refrigerator/lodowka" + a + ".jpg" + if item == 3: + a = str(random.randint(1, 10)) + return "item_images/shelf/polka" + a + ".jpg"