[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdeplayground-edu/ksimon/src
From:       Albert Astals Cid <tsdgeos () terra ! es>
Date:       2005-02-20 13:37:06
Message-ID: 20050220133706.5957E1B912 () office ! kde ! org
[Download RAW message or body]

CVS commit by aacid: 

Here comes the beggining of the score "widget"


  A            number.cpp   1.1 [GPL (v2+)]
  A            number.h   1.1 [GPL (v2+)]
  M +1 -1      Makefile.am   1.5
  M +5 -0      ksimon.cpp   1.15
  M +5 -0      simongame.cpp   1.10
  M +1 -0      simongame.h   1.9


--- kdeplayground-edu/ksimon/src/Makefile.am  #1.4:1.5
@@ -6,5 +6,5 @@
 ksimon_LDADD = $(LIB_KDEUI) -lartskde
 
-ksimon_SOURCES = main.cpp ksimon.cpp artsplayer.cpp simongame.cpp
+ksimon_SOURCES = main.cpp ksimon.cpp artsplayer.cpp simongame.cpp number.cpp
 
 METASOURCES = AUTO

--- kdeplayground-edu/ksimon/src/ksimon.cpp  #1.14:1.15
@@ -18,4 +18,5 @@
 
 #include "ksimon.h"
+#include "number.h"
 
 KSimon::KSimon() : QWidget(0, 0, WStaticContents | WNoAutoErase), m_number1(0), \
m_number2(0), m_number3(0), m_overMenu(false), m_overQuit(false), m_overStart(false), \
m_highlighted(simonGame::none) @@ -65,4 +66,8 @@ void KSimon::paintEvent(QPaintEvent \
*)  
                 default:
+                        p.translate(327, 125);
+                        number n(m_game.score());
+                        n.paint(p, 2);
+                        p.translate(-327, -125);
                 break;
         }

--- kdeplayground-edu/ksimon/src/simongame.cpp  #1.9:1.10
@@ -37,4 +37,9 @@ simonGame::gamePhase simonGame::phase() 
 }
 
+int simonGame::score() const
+{
+        return m_sequenceLength - 2;
+}
+
 void simonGame::clicked(color c)
 {

--- kdeplayground-edu/ksimon/src/simongame.h  #1.8:1.9
@@ -29,4 +29,5 @@ Q_OBJECT
                 int level() const;
                 gamePhase phase() const;
+                int score() const;
                 
                 void clicked(color c);


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic