/[eliot]/eliot/utils/ncurses.cpp
ViewVC logotype

Diff of /eliot/utils/ncurses.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.12 by ipkiss, Sun Oct 23 14:53:44 2005 UTC revision 1.12.2.1 by afrab, Sun Oct 23 17:16:24 2005 UTC
# Line 136  void CursesIntf::drawBoard(WINDOW *win, Line 136  void CursesIntf::drawBoard(WINDOW *win,
136      }      }
137    
138      // The board itself      // The board itself
139        Board board = m_game->getBoard();
140      for (int row = 1; row < 16; row++)      for (int row = 1; row < 16; row++)
141      {      {
142          for (int col = 1; col < 16; col++)          for (int col = 1; col < 16; col++)
143          {          {
144              // Handle colors              // Handle colors
145              int wm = m_game->getBoardWordMultiplier(row, col);              int wm = board.getWordMultiplier(row, col);
146              int lm = m_game->getBoardLetterMultiplier(row, col);              int lm = board.getLetterMultiplier(row, col);
147              if (wm == 3)              if (wm == 3)
148                  wattron(win, COLOR_PAIR(COLOR_RED));                  wattron(win, COLOR_PAIR(COLOR_RED));
149              else if (wm == 2)              else if (wm == 2)
# Line 158  void CursesIntf::drawBoard(WINDOW *win, Line 159  void CursesIntf::drawBoard(WINDOW *win,
159              mvwprintw(win, y + row + 1, x + 3 * col + 1, "   ");              mvwprintw(win, y + row + 1, x + 3 * col + 1, "   ");
160    
161              // Now add the letter              // Now add the letter
162              char c = m_game->getBoardChar(row, col);              char c = board.getChar(row, col);
163              if (c)              if (c)
164              {              {
165                  if (islower(c))                  if (islower(c))
# Line 184  void CursesIntf::drawScoresRacks(WINDOW Line 185  void CursesIntf::drawScoresRacks(WINDOW
185      drawBox(win, y, x, m_game->getNPlayers() + 2, 25, _(" Scores "));      drawBox(win, y, x, m_game->getNPlayers() + 2, 25, _(" Scores "));
186      for (int i = 0; i < m_game->getNPlayers(); i++)      for (int i = 0; i < m_game->getNPlayers(); i++)
187      {      {
188          if (m_game->getMode() != Game::kTRAINING && i == m_game->currPlayer())          if (m_game->getMode() != Game::kTRAINING && i == m_game->getCurrentPlayer())
189              attron(A_BOLD);              attron(A_BOLD);
190          mvwprintw(win, y + i + 1, x + 2,          mvwprintw(win, y + i + 1, x + 2,
191                    _("Player %d: %d"), i, m_game->getPlayerPoints(i));                    _("Player %d: %d"), i, m_game->getPlayerPoints(i));
192          if (m_game->getMode() != Game::kTRAINING && i == m_game->currPlayer())          if (m_game->getMode() != Game::kTRAINING && i == m_game->getCurrentPlayer())
193              attroff(A_BOLD);              attroff(A_BOLD);
194      }      }
195    
# Line 198  void CursesIntf::drawScoresRacks(WINDOW Line 199  void CursesIntf::drawScoresRacks(WINDOW
199      drawBox(win, y + yOff, x, m_game->getNPlayers() + 2, 25, _(" Racks "));      drawBox(win, y + yOff, x, m_game->getNPlayers() + 2, 25, _(" Racks "));
200      for (int i = 0; i < m_game->getNPlayers(); i++)      for (int i = 0; i < m_game->getNPlayers(); i++)
201      {      {
202          if (m_game->getMode() != Game::kTRAINING && i == m_game->currPlayer())          if (m_game->getMode() != Game::kTRAINING && i == m_game->getCurrentPlayer())
203              attron(A_BOLD);              attron(A_BOLD);
204          mvwprintw(win, y + yOff + i + 1, x + 2,          mvwprintw(win, y + yOff + i + 1, x + 2,
205                    _("Player %d: %s"), i, m_game->getPlayerRack(i).c_str());                    _("Player %d: %s"), i, m_game->getPlayerRack(i).c_str());
206          if (m_game->getMode() != Game::kTRAINING && i == m_game->currPlayer())          if (m_game->getMode() != Game::kTRAINING && i == m_game->getCurrentPlayer())
207              attroff(A_BOLD);              attroff(A_BOLD);
208          // Force to refresh the whole rack          // Force to refresh the whole rack
209          whline(win, ' ', 7 - m_game->getPlayerRack(i).size());          whline(win, ' ', 7 - m_game->getPlayerRack(i).size());
# Line 466  void CursesIntf::passTurn(WINDOW *win, i Line 467  void CursesIntf::passTurn(WINDOW *win, i
467      string letters;      string letters;
468      if (readString(win, y + 2, x + 2, 7, letters))      if (readString(win, y + 2, x + 2, 7, letters))
469      {      {
470          int res = iGame.pass(letters, m_game->currPlayer());          int res = iGame.pass(letters, m_game->getCurrentPlayer());
471          if (res)          if (res)
472          {          {
473              drawStatus(win, LINES - 1, 0, _("Cannot pass the turn"));              drawStatus(win, LINES - 1, 0, _("Cannot pass the turn"));
# Line 486  void CursesIntf::setRack(WINDOW *win, in Line 487  void CursesIntf::setRack(WINDOW *win, in
487      string letters;      string letters;
488      if (readString(win, y + 2, x + 2, 7, letters, kJOKER))      if (readString(win, y + 2, x + 2, 7, letters, kJOKER))
489      {      {
490          iGame.setRackManual(false, letters);          iGame.setRackManual(0, false, letters);
491      }      }
492      m_state = DEFAULT;      m_state = DEFAULT;
493      clearRect(win, y, x, 4, 32);      clearRect(win, y, x, 4, 32);

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.12.2.1

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26