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


C++ Main::loadSharedScripts方法代码示例

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


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

示例1: tiles

RS::Bundle::Bundle(Main &main, OCamlBinding &ocaml)
	: tiles(make_tiles())
	, act(WIN_SIZEVI)
{
	ftui::Activity			&act = this->act;
	auto					pushFun =
		[&](std::string const &fname, lua_CFunction f)
		{ act.registerLuaCFun_table("ResultState", fname, f); };
	std::ifstream			is("res/layout/result_state.xml");

	act.inflate(is);
	main.loadSharedScripts(act);
	luaL_dostring(act.getLuaState()
				  , "ResultState = {}; GridColor = 0x0000FF;");
	pushFun("tagForLeave", &tagForLeaveG);
	this->act.fireEvent("ON_GAME_LOADED");
	return ;
}
开发者ID:Ngoguey42,项目名称:proj16_algo_N-puzzle,代码行数:18,代码来源:ResultState.cpp

示例2: tiles

PS::Bundle::Bundle(Main &main, OCamlBinding &ocaml)
	: tiles(make_tiles())
	, act(WIN_SIZEVI)
	, selectedId(0)
	, grids({Grid::def})
{
	ftui::Activity			&act = this->act;
	auto					pushFun =
		[&](std::string const &fname, lua_CFunction f)
		{ act.registerLuaCFun_table("PickState", fname, f); };
	std::ifstream			is("res/layout/pick_state.xml");
	Grid					*gr;

	act.inflate(is);
	main.loadSharedScripts(act);
	luaL_dostring(act.getLuaState()
				  , "PickState = {}; GridColor = 0x0000FF;");
	pushFun("selectGrid", &selectGridG);
	pushFun("deleteGrid", &deleteGridG);

	pushFun("pushRandomGrid", &pushRandomGridG);

	pushFun("getNumGrids", &getNumGridsG);
	pushFun("getGridName", &getGridNameG);
	pushFun("getGrid", &getGridG);
	pushFun("getMainGridId", &getMainGridIdG);

	pushFun("useDefaultGrid", &useDefaultGridG);
	pushFun("setAlgorithmId", &setAlgorithmIdG);
	pushFun("setHeuristicId", &setHeuristicIdG);
	pushFun("setCost", &setCostG);
	pushFun("tagForSolving", &tagForSolvingG);
	for (auto const &fileName : main.files)
	{
		this->grids.emplace_back(fileName);
		gr = &this->grids[this->grids.size() - 1];
		gr->convert(ocaml.transposition_toabstract(gr->getSize()));
	}
	// this->act.fireEvent("GRID_LIST_UPDATE", this->extractGridNames()
	// 					, this->grids.size());
	this->act.fireEvent("ON_GAME_LOADED");
	return ;
}
开发者ID:Ngoguey42,项目名称:proj16_algo_N-puzzle,代码行数:43,代码来源:PickState.cpp


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