@@ -220,7 +220,6 @@ def __init__(self, *, data, war):
220220 self .total_attacks = self ._war .team_size * 2
221221 self .stars = data .get ('stars' )
222222 self .max_stars = self ._war .team_size * 3
223- self .destruction = []
224223
225224 for mdata in data .get ('members' , []):
226225 member = WarMember (data = mdata , war = self ._war )
@@ -1151,3 +1150,45 @@ class LeagueWar(CurrentWar):
11511150 def __init__ (self , * , data ):
11521151 self .tag = data .get ('tag' , None )
11531152 super (LeagueWar , self ).__init__ (data = data )
1153+
1154+
1155+ class LeagueWarLogEntry :
1156+ """Represents a Clash of Clans War Log entry for a League Season
1157+
1158+ Attributes
1159+ -----------
1160+ end_time:
1161+ :class:`Timestamp` - The end time of the war as a Timestamp object
1162+ team_size:
1163+ :class:`int` - The number of players per clan in war
1164+ clan:
1165+ :class:`Clan` - The offensive clan. Note this is only a :class:`Clan`, unlike that of a :class:`WarLog`
1166+ enemy_stars:
1167+ :class:`int` - Total enemy stars for all wars
1168+ attack_count:
1169+ :class:`int` - The total attacks completed by your clan over all wars
1170+ stars:
1171+ :class:`int` The total stars by your clan over all wars
1172+ destruction:
1173+ :class:`float` - The total destruction by your clan over all wars
1174+ clan_level:
1175+ :class:`int` - Your clan level.
1176+ """
1177+
1178+ __slots__ = ('end_time' , 'team_size' , 'clan' , 'enemy_stars' ,
1179+ 'attack_count' , 'stars' , 'destruction' , 'clan_level' )
1180+
1181+ def __init__ (self , * , data ):
1182+ self .end_time = try_enum (Timestamp , data .get ('endTime' ))
1183+ self .team_size = data .get ('teamSize' )
1184+ self .clan = try_enum (Clan , data .get ('clan' ))
1185+ try :
1186+ self .enemy_stars = data ['opponent' ]['stars' ]
1187+ except KeyError :
1188+ self .enemy_stars = None
1189+
1190+ if self .clan :
1191+ self .attack_count = self .clan ._data .get ('attacks' )
1192+ self .stars = self .clan ._data .get ('stars' )
1193+ self .destruction = self .clan ._data .get ('destructionPercentag' )
1194+ self .clan_level = self .clan ._data .get ('clanLevel' )
0 commit comments