Definition at line 11 of file SolverDrawer.h.
Public Member Functions | |
SolverDrawer (LevelStatus *status) | |
Prepares to draw info about best solver. |
|
Prepares to draw info about best solver.
Definition at line 24 of file SolverDrawer.cpp. 00025 { 00026 try { 00027 Font usedFont(Path::dataReadPath("font/font_menu.ttf"), 14); 00028 SDL_Color usedColor = {255, 255, 255, 255}; 00029 00030 Labels labels(Path::dataReadPath("script/labels.lua")); 00031 const char *labelName; 00032 switch (status->compareToBest()) { 00033 case 1: 00034 labelName = "solver_better"; 00035 break; 00036 case 0: 00037 labelName = "solver_equals"; 00038 break; 00039 default: 00040 labelName = "solver_worse"; 00041 } 00042 StringTool::t_args args; 00043 args.push_back(""); 00044 args.push_back(StringTool::toString(status->getBestMoves())); 00045 args.push_back(status->getBestAuthor()); 00046 00047 WiPara *para = new WiPara( 00048 labels.getFormatedLabel(labelName, args), 00049 usedFont, usedColor); 00050 para->enableCentered(); 00051 para->recenter(); 00052 addWidget(para); 00053 } 00054 catch (BaseException &e) { 00055 LOG_WARNING(e.info()); 00056 } 00057 }
|