22 lines
760 B
Python
22 lines
760 B
Python
import random
|
|
from Global_variables import Global_variables as G_var
|
|
from Package import Package
|
|
from Package_types import Package_types
|
|
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):
|
|
package_x = random.randrange(22, 26)
|
|
package_y = random.randrange(1, 13)
|
|
package_type = random.choice(list(Package_types))
|
|
new_package = Package(self.window, package_x, package_y, package_type)
|
|
# sector_type = self.use_decision_tree(new_package, weekend)
|
|
self.enviroment_2d[package_x][package_y] = new_package
|
|
# return sector_type
|
|
|