]> git.sesse.net Git - ccbs/commitdiff
Make the bigscreen application read in the number of players per machine, but don...
authorSteinar H. Gunderson <sesse@samfundet.no>
Fri, 4 Mar 2005 22:47:22 +0000 (22:47 +0000)
committerSteinar H. Gunderson <sesse@samfundet.no>
Fri, 4 Mar 2005 22:47:22 +0000 (22:47 +0000)
bigscreen/ccbs_bigscreen.cpp
bigscreen/fetch_list_of_active_groups.h
bigscreen/groupscreen.cpp
bigscreen/groupscreen.h

index dcf8a78245af878042bc83b583fc08febe0baf54..8e65990f1dcdcac2a3ec999ed2e22b54d4330dea 100644 (file)
@@ -52,7 +52,7 @@ void init(pqxx::connection &conn)
                        for (unsigned j = 0; j < i->num_machines; ++j) {
                                RotateScreen *rs = new RotateScreen();
                                screens.push_back(rs);
-                               rs->add_screen(new GroupScreen(conn, i->tournament, i->round, i->parallel, j, i->num_machines));
+                               rs->add_screen(new GroupScreen(conn, i->tournament, i->round, i->parallel, j, i->num_machines, i->players_per_machine));
                        }
                }
        }
@@ -90,7 +90,7 @@ void init(pqxx::connection &conn)
                conn.perform(FetchListOfFinishedGroups(active_tournament.id, &finished_groups));
                        
                for (std::vector<SkeletonGroup>::const_iterator i = finished_groups.begin(); i != finished_groups.end(); ++i) {
-                       finished_groups_screen->add_screen(new GroupScreen(conn, i->tournament, i->round, i->parallel, 0, 1));
+                       finished_groups_screen->add_screen(new GroupScreen(conn, i->tournament, i->round, i->parallel, 0, 1, 1));
                }
        }
        
index fbac624bf97656e2cc550fc1588926509998f0c8..68f0500bd6ba22bfbc7d9bac70671df1b8c9cda1 100644 (file)
@@ -5,7 +5,7 @@
 #include <vector>
 
 struct SkeletonGroup {
-       unsigned tournament, round, parallel, num_machines;
+       unsigned tournament, round, parallel, num_machines, players_per_machine;
 };
 
 /* A transactor that fetches the current list of active groups. */
index 713c3b944d4d39c05c48a099ed631179a1517186..b7cb2990df536802ac0ee61e1e32a8e3f974724d 100644 (file)
@@ -11,8 +11,8 @@
 #include "fetch_highscore.h"
 #include "fonts.h"
 
-GroupScreen::GroupScreen(pqxx::connection &conn, unsigned tournament, unsigned round, unsigned parallel, unsigned machine, unsigned num_machines)
-       : tournament(tournament), round(round), parallel(parallel), machine(machine), num_machines(num_machines), scores_changed(conn, "scores"), conn(conn), valid(false)
+GroupScreen::GroupScreen(pqxx::connection &conn, unsigned tournament, unsigned round, unsigned parallel, unsigned machine, unsigned num_machines, unsigned players_per_machine)
+       : tournament(tournament), round(round), parallel(parallel), machine(machine), num_machines(num_machines), players_per_machine(players_per_machine), scores_changed(conn, "scores"), conn(conn), valid(false)
 {
 }
 
index fb27787b34813e1ca39f6708aed6cec7a610c899..d0175883b61790c954c8f1b1d87ed84c0371befa 100644 (file)
@@ -14,7 +14,7 @@
 /* A screen class showing a group in the tournament */
 class GroupScreen : public GenericScreen {
 private:
-       unsigned tournament, round, parallel, machine, num_machines;
+       unsigned tournament, round, parallel, machine, num_machines, players_per_machine;
        FlagTrigger scores_changed;
        pqxx::connection &conn;
        bool valid;
@@ -22,7 +22,8 @@ private:
        std::vector<TextDefer> last_text;
 
 public:
-       GroupScreen(pqxx::connection &conn, unsigned tournament, unsigned round, unsigned parallel, unsigned machine, unsigned num_machines);
+       // the last two parameters should probably not be there, but fetched from GroupScreen itself
+       GroupScreen(pqxx::connection &conn, unsigned tournament, unsigned round, unsigned parallel, unsigned machine, unsigned num_machines, unsigned players_per_machine);
        virtual ~GroupScreen();
 
        bool check_invalidated();