示例#1
0
def _alloc_players_from_db():
    odb = db()
    cursor = odb.get_cursor()
    strsql = "select fieldid, geneid, score, points, holding_days, life_len from %s \
    where play_style = \'%s\'and trade_mode = \'%s\' order by fieldid;" % (tp_table, play_style, trade_mode)
    cursor.execute(strsql)
    for row in cursor:
        i = iter(row)
        fieldid = next(i)
        geneid = next(i)
        score = next(i)
        points = next(i)
        holding_days = next(i)
        life_len = next(i)
        coaches[fieldid].assign_player(player(geneid, play_style, tm, trade_mode, score, points, holding_days, life_len))
示例#2
0
def _gen_player(geneid):
    return player(geneid, play_style, tm, trade_mode)
示例#3
0
 def _gen_player(self, geneid):
     return player(geneid, self.play_style, self.tm, self.trade_mode, self.expected_trade_period)