def evaluate(self, player): for seat in self.seats: score_str = "%s: " % seat.player_name score_str += " + ".join(["%s%s^~" % (get_color_code(x.suit), x.value) for x in seat.data.expeditions]) score_str += " = %s\n" % (get_plural_str(seat.data.curr_score, "point")) self.tell_pre(player, score_str)
def update_printable_layout(self): self.printable_layout = [] self.printable_layout.append(" .---.\n") # Loop through all table rows. for row in range(self.suit_count): left = self.left.data.expeditions[row] right = self.right.data.expeditions[row] suit_char = left.suit[0].upper() left_suit_char = suit_char right_suit_char = suit_char expedition_str = get_color_code(left.suit) expedition_str += self.get_expedition_str(left.hand.reversed()).rjust(18) if self.bonus and len(left.hand) >= self.bonus_length: left_suit_char = "*" if self.bonus and len(right.hand) >= self.bonus_length: right_suit_char = "*" expedition_str += " %s %s %s " % (left_suit_char, self.get_discard_str(row), right_suit_char) expedition_str += self.get_expedition_str(right.hand) expedition_str += "^~\n" self.printable_layout.append(expedition_str) self.printable_layout.append(" | |\n") # Replace the last unnecessary separator row with the end of the board. self.printable_layout[-1] = " `---'\n"