static void set_resource_tables_filter(const gint * we_receive, const gint * we_supply) { if (player_is_viewer(my_player_num())) { lock_resource_tables(); } else { resource_table_set_filter(RESOURCETABLE(want_table), we_receive); resource_table_set_filter(RESOURCETABLE(give_table), we_supply); resource_table_clear(RESOURCETABLE(want_table)); resource_table_clear(RESOURCETABLE(give_table)); } }
gboolean can_submit_quote(void) { gint want_quote[NO_RESOURCE]; gint give_quote[NO_RESOURCE]; resource_table_get_amount(RESOURCETABLE(want_table), want_quote); resource_table_get_amount(RESOURCETABLE(give_table), give_quote); if (resource_count(want_quote) == 0 && resource_count(give_quote) == 0) return FALSE; return !quote_view_trade_exists(QUOTEVIEW(quoteview), give_quote, want_quote) && !player_is_viewer(my_player_num()); }
gboolean can_reject_quote(void) { return !player_is_viewer(my_player_num()) && !quote_view_has_reject(QUOTEVIEW(quoteview), my_player_num()); }
gboolean my_player_viewer(void) { return player_is_viewer(my_player_num()); }