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)
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)
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)
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)
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)
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()))
def refresh(self): self.coffees = InputKun.read_file(self.flavour_file)
def refresh(self): self.draws = InputKun.read_file(self.flavour_file)
def refresh(self): self.weapons = InputKun.read_file(self.flavour_file)
def refresh(self): self.revives = InputKun.read_file(self.flavour_file)
def refresh(self): self.suicides = InputKun.read_file(self.flavour_file)
def load_colosseum(): colosseum = InputKun.load_pickle(FILES + COLOSSEUM + PICK) if colosseum is None: colosseum = Colosseum() return colosseum
def stateful_dequeue(): colosseum = InputKun.load_pickle(COLOSSEUM) if colosseum is None: raise Exception("Wrong pickle") OutputChan.process_queue(QUEUEDIR)