示例#1
0
文件: Game.cpp 项目: zapo/BomberSFML
void Game::run() {

	window->GetMainLayer().addObject(mapSprite, 0);

	addCharacter(getMainCharacter().getId(), getMainCharacter());

	if(isFrameratePrinted) {
		window->GetInterfaceLayer().addObject(framerate, 1);
	}

	if(isLatencyPrinted) {
		window->GetInterfaceLayer().addObject(latency, 1);
	}

	window->Launch();

	if (connection->auth()) {

		std::cout << "Authenticated !" << std::endl;

		while (window->IsOpened()) {

			//main game loop

			sf::Sleep(0.01);

			updateCharacters();
			updateMainView();
			updateInterfaceView();

		}
	}

	window->Wait();
}
示例#2
0
void LogViewer::onEntitySelected(const QModelIndex &index)
{
    Tpl::EntityPtr entity = index.data(EntityModel::EntityRole).value<Tpl::EntityPtr>();
    Tp::AccountPtr account = index.data(EntityModel::AccountRole).value<Tp::AccountPtr>();

    ui->datePicker->setEntity(account, entity);

    updateMainView();
}
示例#3
0
void LogViewer::onDateSelected()
{
    updateMainView();
}