当前位置: 首页>>代码示例>>C++>>正文


C++ Weather::get_wind_dir_str方法代码示例

本文整理汇总了C++中Weather::get_wind_dir_str方法的典型用法代码示例。如果您正苦于以下问题:C++ Weather::get_wind_dir_str方法的具体用法?C++ Weather::get_wind_dir_str怎么用?C++ Weather::get_wind_dir_str使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Weather的用法示例。


在下文中一共展示了Weather::get_wind_dir_str方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: if

CommandBarNewUI::CommandBarNewUI(Game *g) : CommandBar()
{
    game = g;
    background = NULL;
    Weather *weather;
    uint16 x_off = game->get_game_x_offset();
    uint16 y_off = game->get_game_y_offset();

    icon_w = 5;
    icon_h = 3;
	uint8 text_height;
	uint16 map_width;
	uint16 map_height;

	offset = OBJLIST_OFFSET_U6_COMMAND_BAR;

	if(game->get_game_type() == NUVIE_GAME_U6)
	{
		num_icons = table_size_U6;
		for (uint8 i = 0; i < table_size_U6; i++)
			mode_name_tbl[i] = U6_mode_name_tbl[i];
	}
	else if(game->get_game_type() == NUVIE_GAME_SE)
	{
		num_icons = table_size_SE;
		for (uint8 i = 0; i < table_size_SE; i++)
			mode_name_tbl[i] = SE_mode_name_tbl[i];
	}
	else // MD
	{
		num_icons = table_size_MD;
		for (uint8 i = 0; i < table_size_MD; i++)
			mode_name_tbl[i] = MD_mode_name_tbl[i];
	}

	if(game->is_orig_style())
	{
		text_height = 8;
		icon_y_offset = 0;
		map_width = 176;
		map_height = 176;
	}
	else
	{
		if(game->get_game_type() == NUVIE_GAME_U6)
		{
			text_height = 17;
			icon_y_offset = 9;
		} else {
			text_height = 8;
			icon_y_offset = 0;
		}
		if(game->is_original_plus())
			map_width = game->get_game_width() - game->get_background()->get_border_width();
		else
			map_width = game->get_game_width();
		map_height = game->get_game_height();
	}
	uint8 command_width = btn_size * icon_w;
	uint8 command_height = btn_size * icon_h + text_height;

	Init(NULL, (map_width - command_width)/2 + x_off, (map_height - command_height)/2 + y_off, 0, 0);
	area.w = command_width; // space for 5x3 icons
	area.h = command_height;

    event = NULL; // it's not set yet
    
    weather = game->get_weather();
    
    selected_action = -1;
    combat_mode = false;
    wind = weather->get_wind_dir_str();

    bg_color = game->get_palette()->get_bg_color();

        init_buttons();
    if(game->get_game_type() == NUVIE_GAME_U6 && !game->is_orig_style())
        weather->add_wind_change_notification_callback((CallBack *)this); //we want to know when the wind direction changes.

    cur_pos = 0;

    font = game->get_font_manager()->get_conv_font();
}
开发者ID:Zabeus,项目名称:nuvie,代码行数:83,代码来源:CommandBarNewUI.cpp


注:本文中的Weather::get_wind_dir_str方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。