From: Steinar H. Gunderson Date: Sat, 19 Feb 2005 16:18:42 +0000 (+0000) Subject: Commit groupscreen.cpp... X-Git-Url: https://git.sesse.net/?p=ccbs;a=commitdiff_plain;h=5271fcfed7f46d4fe481c63f4ea049e6fb83e8c4 Commit groupscreen.cpp... --- diff --git a/bigscreen/groupscreen.cpp b/bigscreen/groupscreen.cpp new file mode 100644 index 0000000..e410de9 --- /dev/null +++ b/bigscreen/groupscreen.cpp @@ -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; +} +