示例#1
0
文件: quote.c 项目: jquick/pioneers
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));
	}
}
示例#2
0
文件: quote.c 项目: jquick/pioneers
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());
}
示例#3
0
文件: quote.c 项目: jquick/pioneers
gboolean can_reject_quote(void)
{
	return !player_is_viewer(my_player_num()) &&
	    !quote_view_has_reject(QUOTEVIEW(quoteview), my_player_num());
}
示例#4
0
gboolean my_player_viewer(void)
{
	return player_is_viewer(my_player_num());
}