]> git.sesse.net Git - pkanalytics/blobdiff - events.h
Make it possible to seek to an event by clicking on it.
[pkanalytics] / events.h
index e86d02bf0b1273bc11d05ebd252d5f6b641ef862..56fcbaff53a07ec93278b9af3a9d4bcc94794229 100644 (file)
--- a/events.h
+++ b/events.h
@@ -25,8 +25,18 @@ public:
        QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
        QVariant data(const QModelIndex &index, int role) const override;
 
-       int insert_event(uint64_t t, int player_id);
+       unsigned insert_event(uint64_t t, int player_id);  // Returns the row.
+       void delete_event(unsigned row);
        void set_event_type(unsigned row, const std::string &type);
+       uint64_t get_time(unsigned row) { return events[row].t; }
+
+       struct Status {
+               unsigned our_score, their_score;
+               bool offense;
+               unsigned num_passes;
+               unsigned possession_sec;
+       };
+       Status get_status_at(uint64_t t);
 
 private:
        struct Player {
@@ -37,6 +47,7 @@ private:
        mutable std::map<int, Player> players;
 
        struct Event {
+               int event_id;
                uint64_t t;
                std::optional<int> player_id;
                std::string type;