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));
}
}
}
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));
}
}
#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. */
#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)
{
}
/* 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;
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();