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


C++ Level::begin方法代码示例

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


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

示例1: smallestRouteFile

int smallestRouteFile(const string &f) {
	int i, r;
	Grid v;
	Level l;
	
	//Init
	v = readFile(f);
	
	//Copy left side numbers
	for(i = 0; i < v.size(); i++)
		l.push_back(v[i][0]);
	
	//Calc smallest to right
	for(i = 1; i < v.size(); i++)
		l = NextLevel(v, l, i);
	
	//get smallest at first position
	sort(l.begin(), l.end());
	
	return l[0];
}
开发者ID:IamLupo,项目名称:Project-Euler,代码行数:21,代码来源:main.cpp

示例2: addLevel

SymbolTable::iterator SymbolTable::addLevel(Level lev, SymbolTable::iterator before){
	auto chk = lookup.find(lev.name);
	if(chk != lookup.end()){
		iterator iter = chk->second;
		iter->merge(lev.begin(), lev.end());
		return iter;
	}else if(before!=levelList.end()){
		double ind1 = before->getIndex();
		double ind2 = ind1-10;
		if(ind2 < 0) throw TableException();
		else if(!before->prev.empty()) ind2 = getLevel(before->prev)->getIndex();
		
		lev.setIndex((ind1+ind2)/2);
		lev.prev = before->prev;
		before->prev = lev.name;
	}else{
		lev.setIndex(mx_ind);
		mx_ind+=1e6;
		lev.prev = (--levelList.end())->name;
	}
	levelList.push_back(lev);
	return lookup[lev.name] = --levelList.end();
	
}
开发者ID:Koensw,项目名称:Kintex,代码行数:24,代码来源:table.cpp

示例3: run

void Game::run(){
	sf::Clock clock;
	c::initialize();
	logger::timing("Constants initialized in " + to_string(clock.getElapsedTime().asSeconds()) + " seconds.");
	clock.restart();
	gi::initalize(window);
	gi::smoothCamera = true;
	logger::timing("Graphics interface initialized in " + to_string(clock.getElapsedTime().asSeconds()) + " seconds.");

	gi::renderWindow->setMouseCursorVisible(false);

	Level* level = NULL;

	Time lastTime;
	while(gi::startOfFrame()){
		if(!managerInitialized){
			gi::darken(1.0f);
			gi::endOfFrame();
			clock.restart();
			manager = new Manager();
			manager->initialize(window);
			logger::timing("Manager initialized in " + to_string(clock.getElapsedTime().asSeconds()) + " seconds.");
			controller = new Controller();
			controller->initialize(manager);
			managerInitialized = true;
			continue;
		}
		if(level == NULL){
			gi::darken(1.0f);
			gi::endOfFrame();
			clock.restart();
			level = new Level(manager, controller);
			level->begin();
			logger::timing("Level initialized in " + to_string(clock.getElapsedTime().asSeconds()) + " seconds.");
			clock.restart();
		}

		if(manager->inputManager->isPressed(Keyboard::Escape)){
			window->close();
		}

		Time time = clock.getElapsedTime();
		float dt = (time - lastTime).asSeconds();

		gi::collisionBoxes = manager->inputManager->isPressed(Keyboard::C);

		manager->tick(window, time, dt);

		window->clear();

		level->tick();

		manager->menuManager->draw(time);

		lastTime = time;
		gi::endOfFrame();
	}
	delete level;
	manager->finalize(window);
	delete manager;
	gi::finalize();
	delete controller;
}
开发者ID:a15johah,项目名称:No-Man-Left-Behind,代码行数:63,代码来源:Game.cpp


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