Skip to content

Commit 8b390ff

Browse files
committed
Lineup is now a Team property.
1 parent 0bcdb3b commit 8b390ff

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

sc2reader/objects.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,22 @@ class Team(object):
3535
#: One of "Win", "Loss", or "Unknown"
3636
result = str()
3737

38-
#: A string representation of the team play races like PP or TPZZ. Random
39-
#: pick races are not reflected in this string
40-
lineup = str()
41-
4238
def __init__(self, number):
4339
self.number = number
4440
self.players = list()
4541
self.result = "Unknown"
46-
self.lineup = ""
4742

4843
def __iter__(self):
4944
return self.players.__iter__()
5045

46+
@property
47+
def lineup(self):
48+
"""
49+
A string representation of the team play races like PP or TPZZ. Random
50+
pick races are not reflected in this string
51+
"""
52+
return ''.join(sorted(p.play_race[0].upper() for p in self.players))
53+
5154
@property
5255
def hash(self):
5356
raw_hash = ','.join(sorted(p.url for p in self.players))

sc2reader/resources.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -425,10 +425,6 @@ def get_team(team_id):
425425
self.teams.sort(key=lambda t: t.number)
426426
self.humans = self.clients = self.people
427427

428-
#Create an store an ordered lineup string
429-
for team in self.teams:
430-
team.lineup = ''.join(sorted(player.play_race[0].upper() for player in team))
431-
432428
self.real_type = real_type(self.teams)
433429

434430
# Assign the default region to computer players for consistency

0 commit comments

Comments
 (0)