void Game::record() { winLose = getWin(); Link *temp = p1.getBdFront(); while (temp != NULL) { score.push_back(temp->data); temp = temp->LinkPtr; } }
// this uses strings and vectors heavily so it is OK to use 'using' void WindowManager::setWinParams(TInt winId, const std::string ¶ms) { TuringWindow* win = getWin(winId); std::vector<std::string> items; WindowManager::split(items, params, ","); std::vector<std::string>::const_iterator item = items.begin(); for (; item != items.end(); ++item) { std::vector<std::string> parts; split(parts,*item, ":;"); // split by either if (parts.size() == 0) TuringCommon::runtimeError("Malformed window format specifier component."); std::string tagname = parts[0]; if ((tagname.compare("graphics") == 0 || tagname.compare("screen") == 0) && parts.size() == 3) { // graphics:x;y int x = atoi(parts[1].c_str()); int y = atoi(parts[2].c_str()); if (x < 1 || y < 1) { TuringCommon::runtimeError("Tried to create a window with negative or zero size"); } win->Width = x; win->Height = y; win->Win.SetSize(x,y); } else if (tagname.compare("title") == 0 && parts.size() == 2) { // title:name win->Title = parts[1]; } else if (tagname.compare("offscreenonly") == 0) { win->OffScreenOnly = true; } else if (tagname.compare("nooffscreenonly") == 0) { win->OffScreenOnly = false; } else { TuringCommon::runtimeError("Don't recognize window option. Might just not be implemented.",true); // true = warn } } win->Win.Create(sf::VideoMode(win->Width,win->Height), win->Title,sf::Style::Close,Settings); //set up OpenGL setupOpenGL(win); // clearWin(winId); }
void WindowManager::setCurWin(TInt winId) { TuringWindow *win = getWin(winId); win->Win.SetActive(true); CurWin = winId; }
void WindowManager::clearWin(TInt winId) { TuringWindow *win = getWin(winId); win->Win.Clear(sf::Color(255,255,255)); win->PutLine = 1; }
void WindowManager::updateWindow(TInt winId, bool force) { TuringWindow* win = getWin(winId); if (force || !win->OffScreenOnly) { doWinUpdate(win); } }
rdWin * getBlankListWin(int user, void *userp) { return getWin(user, userp, rdList); }
rdWin * getBlankArtWin(int user, void *userp) { return getWin(user, userp, rdArticle); }