AIprojekt-wozek/Packages_spawner.py

22 lines
760 B
Python
Raw Normal View History

import random
from Global_variables import Global_variables as G_var
from Package import Package
from Package_types import Package_types
2022-05-12 21:16:05 +02:00
from decision_tree.Decision_tree import DecisionTree
class Packages_spawner:
def __init__(self, window,enviroment_2d):
self.window = window
self.enviroment_2d = enviroment_2d
def spawn_package(self):
2022-05-12 21:16:05 +02:00
package_x = random.randrange(22, 26)
package_y = random.randrange(1, 13)
package_type = random.choice(list(Package_types))
2022-05-12 21:16:05 +02:00
new_package = Package(self.window, package_x, package_y, package_type)
2022-05-12 23:19:46 +02:00
# sector_type = self.use_decision_tree(new_package, weekend)
2022-05-12 21:16:05 +02:00
self.enviroment_2d[package_x][package_y] = new_package
2022-05-12 23:19:46 +02:00
# return sector_type
2022-05-12 21:16:05 +02:00