本文整理汇总了C++中MP_INFO函数的典型用法代码示例。如果您正苦于以下问题:C++ MP_INFO函数的具体用法?C++ MP_INFO怎么用?C++ MP_INFO使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了MP_INFO函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: get_jobs
int
get_jobs (int x, int y, int jobs)
{
int q;
if (numof_markets > 0)
{
for (q = 0; q < numof_markets; q++)
{
if ((abs (marketx[q] - x) < MARKET_RANGE
&& abs (markety[q] - y) < MARKET_RANGE
&& (MP_INFO(marketx[q],markety[q]).int_2 > (3 * jobs / 2))))
{
MP_INFO(marketx[q],markety[q]).int_2 -= jobs;
income_tax += jobs;
return (1);
}
}
}
if (get_stuff (x, y, jobs, T_JOBS) != 0)
{
income_tax += jobs;
return (1);
}
return (0);
}
示例2: update_tech_dep
void
update_tech_dep (int x, int y)
{
switch (MP_GROUP(x,y))
{
case (GROUP_ORGANIC_FARM):
MP_INFO(x,y).int_7 = ((double) MP_INFO(x,y).int_1
* ORGANIC_FARM_FOOD_OUTPUT) / MAX_TECH_LEVEL;
break;
case (GROUP_WINDMILL):
#ifdef OLD_POWER_CODE
MP_INFO(x,y).int_5 = WINDMILL_POWER
#else
MP_INFO(x,y).int_1 = WINDMILL_POWER
#endif
+ (((double) MP_INFO(x,y).int_2 * WINDMILL_POWER) / MAX_TECH_LEVEL);
break;
case (GROUP_COAL_POWER):
#ifdef OLD_POWER_CODE
MP_INFO(x,y).int_5 = POWERS_COAL_OUTPUT
#else
MP_INFO(x,y).int_1 = POWERS_COAL_OUTPUT
#endif
+ (((double) MP_INFO(x,y).int_4 * POWERS_COAL_OUTPUT)
/ MAX_TECH_LEVEL);
break;
case (GROUP_SOLAR_POWER):
MP_INFO(x,y).int_3 = POWERS_SOLAR_OUTPUT
+ (((double) MP_INFO(x,y).int_2 * POWERS_SOLAR_OUTPUT)
/ MAX_TECH_LEVEL);
break;
}
}
示例3: get_goods
int
get_goods (int x, int y, int goods)
{
int q;
if (numof_markets > 0)
{
for (q = 0; q < numof_markets; q++)
{
if (abs (marketx[q] - x) < MARKET_RANGE
&& abs (markety[q] - y) < MARKET_RANGE
&& (MP_INFO(marketx[q],markety[q]).int_4
> goods))
{
MP_INFO(marketx[q],markety[q]).int_4 -= goods;
goods_tax += goods;
goods_used += goods;
/* make the waste here. */
MP_INFO(marketx[q],markety[q]).int_7 += goods / 3;
return (1);
}
}
}
if (get_stuff (x, y, goods, T_GOODS) != 0)
{
put_stuff (x, y, goods / 3, T_WASTE);
goods_tax += goods;
goods_used += goods;
return (1);
}
return (0);
}
示例4: remove_people
void remove_people(int num)
{
int x, y;
/* reset housed population so that we can display it correctly */
housed_population = 1;
while (housed_population && (num > 0)) {
housed_population = 0;
for (y = 0; y < WORLD_SIDE_LEN; y++)
for (x = 0; x < WORLD_SIDE_LEN; x++)
if (MP_GROUP_IS_RESIDENCE(x, y) && MP_INFO(x, y).population > 0) {
MP_INFO(x, y).population--;
housed_population += MP_INFO(x, y).population;
num--;
total_evacuated++;
}
}
while (num > 0 && people_pool > 0) {
num--;
total_evacuated++;
people_pool--;
}
refresh_population_text();
/* Note that the previous test was inaccurate. There could be
exactly 1000 people left. */
if (!housed_population && !people_pool) {
ok_dial_box("launch-gone.mes", GOOD, 0L);
}
}
示例5: do_power_line
/*
int_5 is animation schedule
int_6 is the grid it is on
int_7 is a grid timestamp
*/
void
do_power_line (int x, int y)
{
if (grid[MP_INFO(x,y).int_6]->powered == -1)
return;
switch(MP_INFO(x,y).int_5)
{
case 0:
MP_INFO(x,y).int_5 = POWER_MODULUS;
break;
case 1:
if (!(MP_TYPE(x,y) <= 11 && MP_TYPE(x,y) >= 1))
break;
MP_TYPE(x,y) += 11;
break;
case 2:
if (!(MP_TYPE(x,y) >= 11 && MP_TYPE(x,y) <= 22))
break;
MP_TYPE(x,y) -= 11;
break;
}
MP_INFO(x,y).int_5--;
}
示例6: sell_ore
int
sell_ore (int xt, int yt)
{
int i = 0;
i = (MP_INFO(xt,yt).int_5 * PORT_EXPORT_RATE) / 1000;
MP_INFO(xt,yt).int_5 -= i;
return (i * PORT_ORE_RATE);
}
示例7: sell_coal
int
sell_coal (int xt, int yt)
{
int i = 0;
i = (MP_INFO(xt,yt).int_3 * PORT_EXPORT_RATE) / 1000;
MP_INFO(xt,yt).int_3 -= i;
return (i * PORT_COAL_RATE);
}
示例8: sell_goods
int
sell_goods (int xt, int yt)
{
int i = 0;
i = (MP_INFO(xt,yt).int_4 * PORT_EXPORT_RATE) / 1000;
MP_INFO(xt,yt).int_4 -= i;
return (i * PORT_GOODS_RATE);
}
示例9: sell_steel
int
sell_steel (int xt, int yt)
{
int i = 0;
i = (MP_INFO(xt,yt).int_6 * PORT_EXPORT_RATE) / 1000;
MP_INFO(xt,yt).int_6 -= i;
return (i * PORT_STEEL_RATE);
}
示例10: sell_food
int
sell_food (int xt, int yt)
{
int i = 0;
i = (MP_INFO(xt,yt).int_1 * PORT_EXPORT_RATE) / 1000;
MP_INFO(xt,yt).int_1 -= i;
return (i * PORT_FOOD_RATE);
}
示例11: check_bulldoze_area
void
check_bulldoze_area (int x, int y)
{
//no need to bulldoze desert
if( MP_GROUP( x, y ) == GROUP_DESERT )
return;
int xx, yy, g;
if (MP_TYPE(x,y) == CST_USED)
{
xx = MP_INFO(x,y).int_1;
yy = MP_INFO(x,y).int_2;
}
else
{
xx = x;
yy = y;
}
g = MP_GROUP(xx,yy);
if (g == GROUP_MONUMENT && monument_bul_flag == 0)
{
if( last_message_group != GROUP_MONUMENT ){
new Dialog( BULLDOZE_MONUMENT, xx, yy ); // deletes itself
last_message_group = GROUP_MONUMENT;
}
return;
}
else if (g == GROUP_RIVER && river_bul_flag == 0)
{
if( last_message_group != GROUP_RIVER ){
new Dialog( BULLDOZE_RIVER, xx, yy ); // deletes itself
last_message_group = GROUP_RIVER;
}
return;
}
else if (g == GROUP_SHANTY && shanty_bul_flag == 0)
{
if( last_message_group != GROUP_SHANTY ){
new Dialog( BULLDOZE_SHANTY, xx, yy ); // deletes itself
last_message_group = GROUP_SHANTY;
}
return;
}
else if (g == GROUP_TIP)
{
if( last_message_group != GROUP_TIP ){
ok_dial_box ("nobull-tip.mes", BAD, 0L);
last_message_group = GROUP_TIP;
}
return;
}
last_message_group = 0;
getSound()->playSound( "Raze" );
bulldoze_item (xx,yy);
}
示例12: mps_right
void
mps_right (int x, int y)
{
int i = 0;
char s[12];
const char* p;
int g;
snprintf(s,sizeof(s),"%d,%d",x,y);
mps_store_title(i++,s);
i++;
mps_store_title(i++,_("Coverage"));
p = (MP_INFO(x,y).flags & FLAG_FIRE_COVER) ? _("Yes") : _("No");
mps_store_ss(i++,_("Fire"),p);
p = (MP_INFO(x,y).flags & FLAG_HEALTH_COVER) ? _("Yes") : _("No");
mps_store_ss(i++,_("Health"),p);
p = (MP_INFO(x,y).flags & FLAG_CRICKET_COVER) ? _("Yes") : _("No");
mps_store_ss(i++,_("Sport"),p);
i++;
mps_store_title(i++,_("Pollution"));
if (MP_POL(x,y) < 10)
p = _("clear");
else if (MP_POL(x,y) < 25)
p = _("good");
else if (MP_POL(x,y) < 70)
p = _("fair");
else if (MP_POL(x,y) < 190)
p = _("smelly");
else if (MP_POL(x,y) < 450)
p = _("smokey");
else if (MP_POL(x,y) < 1000)
p = _("smoggy");
else if (MP_POL(x,y) < 1700)
p = _("bad");
else if (MP_POL(x,y) < 3000)
p = _("very bad");
else
p = _("death!");
mps_store_sd(i++,p,MP_POL(x,y));
i++;
mps_store_title(i++,_("Bulldoze Cost"));
g = MP_GROUP(x,y);
if (g == 0) { /* Can't bulldoze grass. */
mps_store_title(i++,_("N/A"));
} else {
if (g < 7)
g--; /* translate into button type */
mps_store_d(i++,main_groups[g].bul_cost);
}
}
示例13: mps_health_centre
void mps_health_centre(int x, int y)
{
int i = 0;
mps_store_title(i++, _("Health Centre"));
i++;
mps_store_title(i++, _("Inventory"));
mps_store_sfp(i++, _("Jobs"), MP_INFO(x, y).int_1 * 100.0 / MAX_JOBS_AT_HEALTH_CENTRE);
mps_store_sfp(i++, _("Goods"), MP_INFO(x, y).int_2 * 100.0 / MAX_GOODS_AT_HEALTH_CENTRE);
}
示例14: do_bulldoze_area
void
do_bulldoze_area (short fill, int xx, int yy)
{
int size, x, y;
if (MP_TYPE(xx,yy) == CST_USED)
{
x = MP_INFO(xx,yy).int_1;
y = MP_INFO(xx,yy).int_2;
}
else
{
x = xx;
y = yy;
}
size = MP_SIZE(x,y);
if (MP_GROUP(x,y) == GROUP_SUBSTATION
|| MP_GROUP(x,y) == GROUP_WINDMILL)
remove_a_substation (x, y);
else if (MP_GROUP(x,y) == GROUP_MARKET)
remove_a_market (x, y);
else if (MP_GROUP(x,y) == GROUP_SHANTY)
numof_shanties--;
else if (MP_GROUP(x,y) == GROUP_COMMUNE)
numof_communes--;
people_pool += MP_INFO(x,y).population;
clear_mappoint (fill, x, y);
if (size > 1) /* do size 2 */
{
clear_mappoint (fill, x + 1, y);
clear_mappoint (fill, x, y + 1);
clear_mappoint (fill, x + 1, y + 1);
}
if (size > 2) /* do size 3 */
{
clear_mappoint (fill, x + 2, y);
clear_mappoint (fill, x + 2, y + 1);
clear_mappoint (fill, x + 2, y + 2);
clear_mappoint (fill, x, y + 2);
clear_mappoint (fill, x + 1, y + 2);
}
if (size > 3) /* do size 4 */
{
clear_mappoint (fill, x + 3, y);
clear_mappoint (fill, x + 3, y + 1);
clear_mappoint (fill, x + 3, y + 2);
clear_mappoint (fill, x + 3, y + 3);
clear_mappoint (fill, x, y + 3);
clear_mappoint (fill, x + 1, y + 3);
clear_mappoint (fill, x + 2, y + 3);
}
}
示例15: list_chapters
static void list_chapters(stream_t *stream, ifo_handle_t *vts_file, tt_srpt_t *tt_srpt, int title_no)
{
MP_INFO(stream, "CHAPTERS: ");
for (int n = 0; ; n++) {
double p = n;
int r;
r = get_chapter_time(vts_file, tt_srpt, title_no, &p);
if (!r)
break;
int t = p * 1000;
MP_INFO(stream, "%02d:%02d:%02d.%03d,", t/3600000, (t/60000)%60, (t/1000)%60, t%1000);
}
MP_INFO(stream, "\n");
}