本文整理汇总了C++中Puzzle::setVisualizationFlag方法的典型用法代码示例。如果您正苦于以下问题:C++ Puzzle::setVisualizationFlag方法的具体用法?C++ Puzzle::setVisualizationFlag怎么用?C++ Puzzle::setVisualizationFlag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Puzzle
的用法示例。
在下文中一共展示了Puzzle::setVisualizationFlag方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char** argv)
{
freopen("CON", "w", stdout); // redirects stdout because SDL redirects it to a file.
/* Parsing the input parameters. */
if (argc < 6)
{
std::cout << "Missing some input parametr. Needed at least 5 but got only " << argc - 1 << std::endl;
return -1;
}
if (!initGraphics(RESX, RESY)) return -1;
renderScene();
displayVFB(vfb);
try
{
Puzzle puzzle;
if (!puzzle.loadMap(argv[1]))
throw "Something is wrong with the map file!";
puzzle.setMonsterAndFoodCoords(fromStringToInt(argv[2]), fromStringToInt(argv[3]), fromStringToInt(argv[4]), fromStringToInt(argv[5]));
// The flag for the SDL visualization
if (argc >= 7)
{
puzzle.setVisualizationFlag(fromStringToInt(argv[6]));
}
// The flag for the SDL visualization
if (argc >= 8)
{
puzzle.setDelay(fromStringToInt(argv[7]));
}
puzzle.printMap(std::cout);
puzzle.solveAndVizualize(std::cout);
puzzle.visualizeThePath();
puzzle.basicVisualizePath(std::cout);
puzzle.printFormatedPath(std::cout);
}
catch (const char * msg)
{
std::cout << "Error: " << msg << std::endl;
}
catch (const string msg)
{
std::cout << "Error: " << msg << std::endl;
}
waitForUserExit();
closeGraphics();
return 0;
}