@@ -16,7 +16,8 @@ def __init__(self, **kwargs):
1616 "team2_name" : str ,
1717 "team1_score" : int ,
1818 "team2_score" : int ,
19- "team_id" : str
19+ "team_id" : str ,
20+ "events" : list ,
2021 }
2122
2223 super ().__init__ (data_schema , ** kwargs )
@@ -30,6 +31,8 @@ def add_round(self, data):
3031 teams [self .team2_name ] = Team .from_json ({"name" : self .team2_name , "players" : {}})
3132 self .rounds .append (Round .from_json ({"teams" : teams , "start_time" : data [2 ], "objective_captured" : [], "objective_progress" : []}))
3233
34+ self .events .append ({"type" : "round_start" , "timestamp" : data [2 ], "value" : 1 , "description" : "Round {} start" .format (len (self .rounds ))})
35+
3336 self .actual_round += 1
3437
3538 print ("###### NEW ROUND {} #######" .format (self .actual_round ))
@@ -75,6 +78,8 @@ def add_kill(self, data):
7578 self .rounds [self .actual_round ].teams [data [3 ]].players [data [4 ]].characters [data [5 ]].add_kill (killer_data )
7679 self .rounds [self .actual_round ].teams [data [6 ]].players [data [7 ]].characters [data [8 ]].add_death (victim_data )
7780
81+ self .events .append ({"type" : "kill" , "timestamp" : data [2 ], "value" : 1 , "description" : "{} kill {}" .format (data [4 ], data [7 ])})
82+
7883 def add_player_stat (self , data ):
7984
8085 # self.create_if_player_and_caracter_not_exist(data[4], data[5], data[6])
@@ -149,13 +154,16 @@ def end_round(self, data):
149154 self .rounds [self .actual_round ].teams [team ].players [player ].characters [character ].played_time [- 1 ]["end" ] = end_round_data ["time" ]
150155
151156
152- self .score_team1 = end_round_data ["team1_score" ]
153- self .score_team2 = end_round_data ["team2_score" ]
157+ self .team1_score = end_round_data ["team1_score" ]
158+ self .team2_score = end_round_data ["team2_score" ]
159+ print (" score team 1 : " , self .team1_score )
160+ print (" score team 2 : " , self .team2_score )
154161 print ("###### END ROUND {} #######\n " .format (self .actual_round ))
155162
163+
156164 def end_map (self , data ):
157165
158166 end_map_data = {"time" : data [2 ], "team1_score" : data [4 ], "team2_score" : data [5 ]}
159167
160- self .score_team1 = end_map_data ["team1_score" ]
161- self .score_team2 = end_map_data ["team2_score" ]
168+ self .team1_score = end_map_data ["team1_score" ]
169+ self .team2_score = end_map_data ["team2_score" ]
0 commit comments