Exemplo n.º 1
0
    def __init__(self, frequency, col, killer_picker):
        if killer_picker is None or col is None:
            raise EventError(
                "Init error: Null parameters passed to the constructor method")

        self.frequency = frequency if not frequency is None else 1
        self.colosseum = col
        self.killerPicker = killer_picker
        self.suicides = InputKun.read_file(self.flavour_file)
Exemplo n.º 2
0
def update_probabilities():
    colosseum = load_colosseum()
    new_probabilities = InputKun.read_file(PROBFILE)
    for line in new_probabilities:
        tokens = line.split('=')
        colosseum.update_event_probability(tokens[0].strip(),
                                           float(tokens[1].strip()))

    OutputChan.save_pickle(FILES + COLOSSEUM + PICK, colosseum)
Exemplo n.º 3
0
    def __init__(self, frequency, col, shaman_picker, cursed_picker):
        if shaman_picker is None or cursed_picker is None or col is None:
            raise EventError(
                "Init error: Null parameters passed to the constructor method")

        self.frequency = frequency if not frequency is None else 1
        self.colosseum = col
        self.shamanPiker = shaman_picker
        self.cursedPicker = cursed_picker
        self.curses = InputKun.read_file(self.flavour_file)
Exemplo n.º 4
0
    def __init__(self, frequency, col, picker):
        if picker is None or col is None:
            raise EventError(
                "Init error: Null parameters passed to the constructor method")

        self.frequency = frequency if not frequency is None else 1
        self.lastTweet = ""
        self.curretTweet = ""
        self.colosseum = col
        self.picker = picker
        self.coffees = InputKun.read_file(self.flavour_file)
Exemplo n.º 5
0
    def __init__(self, frequency, col, killer_picker, victim_picker):
        if killer_picker is None or victim_picker is None or col is None:
            raise EventError(
                "Init error: Null parameters passed to the constructor method")

        self.frequency = frequency if not frequency is None else 1
        self.lastTweet = ""
        self.curretTweet = ""
        self.colosseum = col
        self.killerPicker = killer_picker
        self.victimPicker = victim_picker
        self.weapons = InputKun.read_file(self.flavour_file)
Exemplo n.º 6
0
    def __init__(self):

        # TODO change this to constants
        self.harpies = Arpio.harpy_factory(InputKun.read_file(HARPIESFILE))
        self.stats = Status()
        self.stats.alive = len(self.harpies)

        self.events = []
        self.events.append(
            Assassination(87.5, self, KillerPicker(), VictimPicker()))
        self.events.append(Coffee(2.5, self, RandomPicker()))
        self.events.append(Suicide(2.5, self, KillerPicker()))
        self.events.append(Revive(2.5, self, RandomPicker(), RandomPicker()))
        self.events.append(Curse(2.5, self, RandomPicker(), RandomPicker()))
        self.events.append(Draw(2.5, self, KillerPicker(), VictimPicker()))
Exemplo n.º 7
0
 def refresh(self):
     self.coffees = InputKun.read_file(self.flavour_file)
Exemplo n.º 8
0
 def refresh(self):
     self.draws = InputKun.read_file(self.flavour_file)
Exemplo n.º 9
0
 def refresh(self):
     self.weapons = InputKun.read_file(self.flavour_file)
Exemplo n.º 10
0
 def refresh(self):
     self.revives = InputKun.read_file(self.flavour_file)
Exemplo n.º 11
0
 def refresh(self):
     self.suicides = InputKun.read_file(self.flavour_file)
Exemplo n.º 12
0
def load_colosseum():
    colosseum = InputKun.load_pickle(FILES + COLOSSEUM + PICK)
    if colosseum is None:
        colosseum = Colosseum()

    return colosseum
Exemplo n.º 13
0
def stateful_dequeue():
    colosseum = InputKun.load_pickle(COLOSSEUM)
    if colosseum is None:
        raise Exception("Wrong pickle")
    OutputChan.process_queue(QUEUEDIR)