]> git.sesse.net Git - pkanalytics/blobdiff - events.h
Fix formation JSON export.
[pkanalytics] / events.h
index 545437b16d9f181c998cf707e99307b7c849b87f..8922496dc854284fcf4298aec6fabdd3f1d6950d 100644 (file)
--- a/events.h
+++ b/events.h
@@ -38,6 +38,7 @@ public:
        struct Status {
                unsigned our_score, their_score;
                enum { NOT_STARTED, OFFENSE, DEFENSE } attack_state;
+               unsigned offensive_formation, defensive_formation;
                bool stoppage;
                enum { NOT_PULLING, SHOULD_PULL, PULL_IN_AIR } pull_state;
                unsigned num_passes;
@@ -50,6 +51,11 @@ public:
        std::vector<int> sort_team(const std::set<int> &team) const;  // Ordered first by gender, then by number.
        void set_formation_at(uint64_t t, bool offense, unsigned formation);
 
+       // Used to notify when we've inserted a new one into the database.
+       void inserted_new_formation(int formation_id, const std::string &name) {
+               formations[formation_id] = Formation{ formation_id, name };
+       }
+
 private:
        struct Player {
                int player_id;