Module SimEconomica.JobPicker

Expand source code
from Job import JOBS
from Resources import RECIPES
import Settings as SETTINGS

from random import randrange


class BaseJobPicker(object):
    def PickJob(self, **kwargs) -> int:
        pass


class RandomJobPicker(BaseJobPicker):
    def __init__(self):
        self.mJobsRange = range(len(JOBS))
    
    def PickJob(self, **kwargs) -> int:
        return randrange(self.mJobsRange.start, self.mJobsRange.stop)

Classes

class BaseJobPicker
Expand source code
class BaseJobPicker(object):
    def PickJob(self, **kwargs) -> int:
        pass

Subclasses

Methods

def PickJob(self, **kwargs) ‑> int
Expand source code
def PickJob(self, **kwargs) -> int:
    pass
class RandomJobPicker
Expand source code
class RandomJobPicker(BaseJobPicker):
    def __init__(self):
        self.mJobsRange = range(len(JOBS))
    
    def PickJob(self, **kwargs) -> int:
        return randrange(self.mJobsRange.start, self.mJobsRange.stop)

Ancestors

Methods

def PickJob(self, **kwargs) ‑> int
Expand source code
def PickJob(self, **kwargs) -> int:
    return randrange(self.mJobsRange.start, self.mJobsRange.stop)