6 #include <QAbstractTableModel>
11 class EventsModel : public QAbstractTableModel
14 EventsModel(sqlite3 *db);
16 int rowCount(const QModelIndex &parent) const override
20 int columnCount(const QModelIndex &column) const override
24 QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
25 QVariant data(const QModelIndex &index, int role) const override;
27 unsigned insert_event(uint64_t t, int player_id); // Returns the row.
28 void delete_event(unsigned row);
29 void set_event_type(unsigned row, const std::string &type);
30 uint64_t get_time(unsigned row) { return events[row].t; }
33 unsigned our_score, their_score;
36 unsigned possession_sec;
38 Status get_status_at(uint64_t t);
46 std::map<int, Player> players;
51 std::optional<int> player_id;
54 std::vector<Event> events;
61 #endif // !defined(_EVENTS_H)