本文整理汇总了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 ;
}
示例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 ;
}