File tree Expand file tree Collapse file tree 4 files changed +23
-12
lines changed
Expand file tree Collapse file tree 4 files changed +23
-12
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,9 @@ class Character(Object):
66 def __init__ (self , ** kwargs ):
77
88 data_schema = {"name" : str ,
9- "damage" : int }
9+ "damage" : int ,
10+ "heal" : int ,
11+ "ultimate_use" : int }
1012
1113 super ().__init__ (data_schema , ** kwargs )
1214
Original file line number Diff line number Diff line change @@ -23,15 +23,15 @@ def __init__(self, **kwargs):
2323 def add_round (self ):
2424
2525 teams = []
26- teams .append (Team .from_json ({"name" :self .team1_name , "players" : [] }))
27- teams .append (Team .from_json ({"name" :self .team2_name , "players" : [] }))
26+ teams .append (Team .from_json ({"name" :self .team1_name , "players" : {} }))
27+ teams .append (Team .from_json ({"name" :self .team2_name , "players" : {} }))
2828 self .rounds .append (Round .from_json ({"teams" : teams }))
2929
3030 self .actual_round += 1
3131
3232 def add_player (self , data ):
3333
34- for team in self .rounds [self .actual_round ].teams :
34+ for name_team , team in self .rounds [self .actual_round ].teams :
3535
3636 for player in team .players :
3737
@@ -41,5 +41,13 @@ def add_player(self, data):
4141 self .rounds [self .actual_round ].teams [data ["team_number" ]].add_player (data )
4242
4343
44-
45-
44+ def add_character (self , data ):
45+
46+ for team in self .rounds [self .actual_round ].teams :
47+ for player in team .players :
48+ for character in player .characters :
49+
50+ if character .name == data ["name_character" ]:
51+ return - 1
52+
53+ self .rounds [self .actual_round ].teams [data ["team_number" ]].player ["player_name" ].add_character (data )
Original file line number Diff line number Diff line change 11# from src.log_analyser.character import Character
2+ from objects .object import Object
3+ from objects .character import Character
24
35
4- class Player ():
6+ class Player (Object ):
57
68 def __init__ (self , name , team ) -> None :
79
8- self . name = name
9- self . team = team
10+ data_schema = { " name" : str ,
11+ "characters" : list }
1012
11- self . character = []
13+ super (). __init__ ( data_schema , ** kwargs )
1214
13- self .ultimate = 0
1415
1516 def add_event (self , event ):
1617 pass
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ class Round(Object):
55
66 def __init__ (self , ** kwargs ):
77
8- data_schema = {"teams" : list
8+ data_schema = {"teams" : dict
99 }
1010
1111 super ().__init__ (data_schema , ** kwargs )
You can’t perform that action at this time.
0 commit comments