X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=events.h;h=f522734261e5334a675cade7c965dae806f1e4e8;hb=ad5df1fb3de10ee30e9442d8d0ac72becf208e0a;hp=8922496dc854284fcf4298aec6fabdd3f1d6950d;hpb=96a511ed5406bf94743854aa8fa99b4137935574;p=pkanalytics diff --git a/events.h b/events.h index 8922496..f522734 100644 --- a/events.h +++ b/events.h @@ -9,6 +9,36 @@ #include #include +enum class EventType { + CATCH, + DEFENSE, + DEFENSIVE_SOFT_MINUS, + DEFENSIVE_SOFT_PLUS, + FORMATION_DEFENSE, + FORMATION_OFFENSE, + DROP, + GOAL, + IN, + INTERCEPTION, + OFFENSIVE_SOFT_MINUS, + OFFENSIVE_SOFT_PLUS, + OUT, + PULL, + PULL_LANDED, + PULL_OOB, + RESTART, + SET_DEFENSE, + SET_OFFENSE, + STALLOUT, + STOPPAGE, + THEIR_GOAL, + THEIR_PULL, + THEIR_THROWAWAY, + THROWAWAY, + UNKNOWN, + WAS_D, +}; + class EventsModel : public QAbstractTableModel { public: @@ -27,7 +57,9 @@ public: unsigned insert_event(uint64_t t, std::optional player_id, std::optional formation_id, const std::string &type = "unknown"); // Returns the row. void delete_event(unsigned row); + EventType get_event_type(unsigned row) { return events[row].type; } void set_event_type(unsigned row, const std::string &type); + void set_event_formation(unsigned row, int formation_id); uint64_t get_time(unsigned row) { return events[row].t; } unsigned get_last_event_pos(uint64_t t) const; // Last event that happened at or before t. QModelIndex get_last_event_qt(uint64_t t) const { @@ -76,7 +108,7 @@ private: uint64_t t; std::optional player_id; std::optional formation_id; - std::string type; + EventType type; }; std::vector events;