]> git.sesse.net Git - ccbs/blobdiff - bigscreen/groupscreen.h
Yet more refactoring.
[ccbs] / bigscreen / groupscreen.h
index c794f60465904d2070c2976f9b9fba95130379ae..09d8d978b039d8ea8e5c8407e45910922daf862f 100644 (file)
@@ -1,21 +1,44 @@
 #ifndef _GROUPSCREEN_H
 #define _GROUPSCREEN_H 1
 
+#include <vector>
+#include <pqxx/connection>
+#include <time.h>
+#include <sys/time.h>
+
+#include "screen.h"
 #include "flagtrigger.h"
 #include "group.h"
+#include "fonts.h"
 
 /* A screen class showing a group in the tournament */
-class GroupScreen : public Screen {
+class GroupScreen : public GenericScreen {
 private:
-       unsigned tournament;
+       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);
+       const Player *get_next_player(const Group &group);
+       void draw_next_up_single(unsigned char *buf, const Group &group, const std::vector<unsigned> &colwidth,
+               std::map<unsigned, unsigned> &song_scores, std::map<unsigned, unsigned> &player_scores,
+               const std::vector<unsigned> &max_score, const std::vector<unsigned> &min_score);
+       void find_column_widths(const Group &group, std::vector<unsigned> &colwidth);
+       
 public:
-       Screen(unsigned tournament);
+       // 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();
 };
 
 #endif /* !defined(_GROUPSCREEN_H) */