def create_median_matches(sim, lst, modify=True): ret = [] for rnd, matches in lst: for m in matches: match = sim.get_match(m) match.compute() mean = match.find_lsup() match.broadcast_instance((0, [mean[4], mean[3]], match)) if modify: match.modify(mean[1], mean[2]) ret.append({}) ret[-1].update(player_data(match.get_player(0).dbpl, 'pla')) ret[-1].update(player_data(match.get_player(1).dbpl, 'plb')) ret[-1].update({ 'pla_score': mean[1], 'plb_score': mean[2], 'eventtext': rnd, 'match_id': smallhash(rnd) + '-med', }) return ret
def create_matches(sim, lst): ret = [] for rnd, matches in lst: for m in matches: match = sim.get_match(m) if not match.can_modify(): continue ret.append({}) ret[-1].update(player_data(match.get_player(0).dbpl, 'pla')) ret[-1].update(player_data(match.get_player(1).dbpl, 'plb')) ret[-1].update({ 'pla_score': match.get_result()[0], 'plb_score': match.get_result()[1], 'unfixed': not match.is_fixed(), 'eventtext': rnd, 'match_id': smallhash(rnd) + '-ent', 'sim': match, 'identifier': m, }) return ret
def create_median_matches(self, sim, prefixes, modify=True): ret = [] for rnd, matches in prefixes: for m in matches: match = sim.get_match(m) match.compute() mean = match.find_lsup() match.broadcast_instance((0, [mean[4], mean[3]], match)) if modify: match.modify(mean[1], mean[2]) ret.append({}) ret[-1]['pla'] = self.player_data(match.get_player(0).dbpl) ret[-1]['plb'] = self.player_data(match.get_player(1).dbpl) ret[-1]['pla']['score'] = mean[1] ret[-1]['plb']['score'] = mean[2] ret[-1].update({ 'eventtext': rnd, 'match_id': smallhash(rnd) + '-med', 'identifier': m, }) return ret
def create_matches(self, sim, prefixes): ret = [] for rnd, matches in prefixes: for m in matches: match = sim.get_match(m) if not match.can_modify(): continue ret.append({}) ret[-1]['pla'] = self.player_data(match.get_player(0).dbpl) ret[-1]['plb'] = self.player_data(match.get_player(1).dbpl) ret[-1]['pla']['score'] = match.get_result()[0] ret[-1]['plb']['score'] = match.get_result()[1] ret[-1].update({ 'unfixed': not match.is_fixed(), 'eventtext': rnd, 'match_id': smallhash(rnd) + '-ent', 'sim': match, 'identifier': m, }) return ret
def create_median_matches(self, sim, prefixes, modify=True): ret = [] for rnd, matches in prefixes: for m in matches: match = sim.get_match(m) match.compute() mean = match.find_lsup() match.broadcast_instance((0, [mean[4], mean[3]], match)) if modify: match.modify(mean[1], mean[2]) ret.append({}) ret[-1]['pla'] = self.player_data(match.get_player(0).dbpl) ret[-1]['plb'] = self.player_data(match.get_player(1).dbpl) ret[-1]['pla']['score'] = mean[1] ret[-1]['plb']['score'] = mean[2] ret[-1].update({ 'eventtext': rnd, 'match_id': smallhash(rnd) + '-med', 'identifier': m, }) return ret
def create_matches(self, sim, prefixes): ret = [] for rnd, matches in prefixes: for m in matches: match = sim.get_match(m) if not match.can_modify(): continue ret.append({}) ret[-1]['pla'] = self.player_data(match.get_player(0).dbpl) ret[-1]['plb'] = self.player_data(match.get_player(1).dbpl) ret[-1]['pla']['score'] = match.get_result()[0] ret[-1]['plb']['score'] = match.get_result()[1] ret[-1].update({ 'unfixed': not match.is_fixed(), 'eventtext': rnd, 'match_id': smallhash(rnd) + '-ent', 'sim': match, 'identifier': m, }) return ret