]> git.sesse.net Git - ccbs/blobdiff - bigscreen/groupscreen.h
More refactoring.
[ccbs] / bigscreen / groupscreen.h
index 1bff23fdb57607009fe3e3def8a1a0083ceb08ad..38ab516dbabb3d1aaf2e3146137395de30ff31b8 100644 (file)
 /* 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;
        struct timeval last_updated;
        std::vector<TextDefer> last_text;
 
+       unsigned get_show_players(const Group &group);
+       void draw_main_heading(std::vector<TextDefer> &td);
+       void draw_column_headings(std::vector<TextDefer> &td, const Group &group, const std::vector<unsigned> &colwidth);
+       void draw_scores(std::vector<TextDefer> &td, const Group &group, const std::vector<unsigned> &colwidth);
+       void find_column_widths(const Group &group, std::vector<unsigned> &colwidth);
+       
 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();
-       void draw(unsigned char *buf);
+       void draw(unsigned char *buf, unsigned width, unsigned height);
        int get_priority();
 };