您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ timeGetTime函数代码示例

51自学网 2021-06-03 08:50:22
  C++
这篇教程C++ timeGetTime函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中timeGetTime函数的典型用法代码示例。如果您正苦于以下问题:C++ timeGetTime函数的具体用法?C++ timeGetTime怎么用?C++ timeGetTime使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

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

示例1: end_battle

void end_battle(void*d){	{char window_title[255];sprintf_s(window_title,255,"SAWD [SPOILS OF WAR] - %s", 	GAME_BUILD_NUMBER); SetConsoleTitle(window_title);}	clibwindow* black_panel = cl->open_window_noframe(0,0,79,49,0,0);	// the enemy that was defeated is passed to this function	obj* e = (obj*)d;	int box[] = {16, 5, 48, 30};	int x = box[0] + 2;	int y = box[1] + 2;	clibwindow* upg_wnd = cl->open_window(box[0], box[1], box[2], box[3]);	unsigned long xp_gained		= e->experience;	unsigned long nxt_xp		= xp_to_level_up();	unsigned long gold_gained	= e->gold;	cl->outcharsf(x, 32, "$%8d", player->gold);	draw_player_stats_end_battle(x, y);	// update the experience	bool next_upg = false; unsigned int counter = 0;	while(!next_upg)	{		cl->outcharsf(x, y, "Battle Experience: %8d / %8d", player->experience, nxt_xp);		player->experience++;		if (player->experience >= nxt_xp)		{			level_up();			nxt_xp = xp_to_level_up();			draw_player_stats_end_battle(x, y); // update stats		}		counter++;		if (counter >= xp_gained)		{			next_upg = true;		}		unsigned long start_time = timeGetTime();		while((timeGetTime() - start_time) < 60);	}	// update the gold	next_upg = false;	counter = 0;	while(!next_upg)	{		cl->outcharsf(x, 32, "$%8d", player->gold);		player->gold++;		counter++;		if (counter >= gold_gained)		{			next_upg = true;		}		unsigned long start_time = timeGetTime();		while((timeGetTime() - start_time) < 60);	}	// show items gained if any	if (e->items.size()>0)	{		display_items_gained(e);		for (unsigned int i = 0; i < e->items.size(); i++)		{			player->items.push_back(get_master_item(e->items.at(i)->name));		}	}	cl->show_message_centered(3,"","Another Victory!","");	cl->close_window(upg_wnd);	cl->close_window(black_panel);}
开发者ID:RichardMarks,项目名称:SAWD,代码行数:76,


示例2: MakeDefaultAttackCoolTime

void ZBrain::ProcessAttack( float fDelta){	bool bDefaultAttackEnabled = true;	// Update time	if ( m_pBody->GetNPCInfo() && (m_pBody->GetNPCInfo()->fAttackCoolTime != 0.0f))		bDefaultAttackEnabled = m_DefaultAttackTimer.Update( fDelta);	if ( !m_AttackTimer.Update(fDelta) && !bDefaultAttackEnabled)		return;	// Skip if friendly NPC	if ( m_Behavior.IsFriendly())		return;	// Check attackable status	if ( !m_pBody->IsAttackable())		return;	// Use default attack	if ( bDefaultAttackEnabled && m_pBody->CanAttackMelee( GetTarget()) && !ZGetGame()->CheckWall(m_pBody, GetTarget(), true))	{	// (
C++ timeKillEvent函数代码示例
C++ timeGetDevCaps函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。