--- /dev/null
+#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;
+}
+