]> git.sesse.net Git - ccbs/commitdiff
Commit groupscreen.cpp...
authorSteinar H. Gunderson <sesse@samfundet.no>
Sat, 19 Feb 2005 16:18:42 +0000 (16:18 +0000)
committerSteinar H. Gunderson <sesse@samfundet.no>
Sat, 19 Feb 2005 16:18:42 +0000 (16:18 +0000)
bigscreen/groupscreen.cpp [new file with mode: 0644]

diff --git a/bigscreen/groupscreen.cpp b/bigscreen/groupscreen.cpp
new file mode 100644 (file)
index 0000000..e410de9
--- /dev/null
@@ -0,0 +1,28 @@
+#include "groupscreen.h"
+#include "fetch_group.h"
+
+GroupScreen::GroupScreen(pqxx::connection &conn, unsigned tournament, unsigned round, unsigned parallel)
+       : tournament(tournament), round(tournament), parallel(parallel), scores_changed(conn, "scores"), conn(conn), valid(false)
+{
+}
+
+GroupScreen::~GroupScreen()
+{
+}
+
+bool GroupScreen::check_invalidated()
+{
+       // we might want to do this slightly more sophisticated later, but for now this will do
+       return !valid || scores_changed.get_flag();
+}
+
+void GroupScreen::draw(unsigned char *buf)
+{
+       scores_changed.reset_flag();
+
+       Group group;
+       conn.perform(FetchGroup(tournament, round, parallel, &group));
+
+       valid = true;
+}
+