From 52f95177eb8050f073a3d65413feb16cfce93baa Mon Sep 17 00:00:00 2001 From: Mario Kilies Date: Tue, 25 Jan 2011 13:14:17 +0100 Subject: Removed awkward pnoc_t and refactored its contents to the new player_list_entry_t. --- src/ui.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/ui.c') diff --git a/src/ui.c b/src/ui.c index 5dd7196..661219a 100644 --- a/src/ui.c +++ b/src/ui.c @@ -207,15 +207,15 @@ void ui_display_wnd_stack_points(const table_stacks_t *ts, const bool highlight, /** * Displays the current state window, showing all player names and their open cards and the client player's score. - * @param[in] pnoc Array of (player name, open card) tuples. Array has to be sorted by open card, lowest open card first + * @param[in] pl Player list. List has to be sorted by open card, in ascending order * @param[in] num_players The number of players to show a player name and open card for * @param[in] highlight If true, a player in the player table will be highlighted * @param[in] highlighted_player The player to highlight * @param[in] score The players score */ -void ui_display_wnd_current_state(const pnoc_t pnoc[], const uint8_t num_players, const bool highlight, const uint8_t highlighted_player, const uint32_t score) +void ui_display_wnd_current_state(const player_list_t *pl, const uint8_t num_players, const bool highlight, const uint8_t highlighted_player, const uint32_t score) { - assert(pnoc != NULL); + assert(pl != NULL); uint8_t pos = 0; wattron(w_current_state, A_BOLD); @@ -228,7 +228,7 @@ void ui_display_wnd_current_state(const pnoc_t pnoc[], const uint8_t num_players for (uint8_t i = 0; i < num_players; i++) { - if (pnoc[i].player_id == 0) // invalid player + if (pl->players[i].player_id == 0) // invalid player continue; if (highlight && i == highlighted_player) @@ -236,19 +236,19 @@ void ui_display_wnd_current_state(const pnoc_t pnoc[], const uint8_t num_players if (pos < 5) { - mvwprintw(w_current_state, 2+pos, 1, "%-s", pnoc[i].player_name); - if (0 == pnoc[i].open_card) + mvwprintw(w_current_state, 2+pos, 1, "%-s", pl->players[i].player_name); + if (0 == pl->players[i].open_card) mvwprintw(w_current_state, 2+pos, 15, "-"); else - mvwprintw(w_current_state, 2+pos, 13, "%3d", pnoc[i].open_card); + mvwprintw(w_current_state, 2+pos, 13, "%3d", pl->players[i].open_card); } else { - mvwprintw(w_current_state, 2+(pos-5), 22, "%-s", pnoc[i].player_name); - if (0 == pnoc[i].open_card) + mvwprintw(w_current_state, 2+(pos-5), 22, "%-s", pl->players[i].player_name); + if (0 == pl->players[i].open_card) mvwprintw(w_current_state, 2+(pos-5), 36, "-"); else - mvwprintw(w_current_state, 2+(pos-5), 34, "%3d", pnoc[i].open_card); + mvwprintw(w_current_state, 2+(pos-5), 34, "%3d", pl->players[i].open_card); } if (highlight && i == highlighted_player) -- cgit v1.2.3