Old revision #pnduplzx4 | New revision #pmbcr4rmo | ||
---|---|---|---|
7 | result = [] | 7 | result = [] |
8 | for industry_type, distance in self.incompatible.items(): | 8 | for industry_type, distance in self.incompatible.items(): |
9 | result.append(LocationCheckIncompatible(industry_type, distance)) | 9 | result.append(LocationCheckIncompatible(industry_type, distance)) |
10 | for index in range(0, len(result) - 1): | 10 | |
11 | result[index].switch_result = switch_prefix + result[index + 1].industry_type | 11 | prev = None |
12 | for lc in reversed(result): | ||
13 | if prev is not None: | ||
14 | lc.switch_result = prev.industry_type | ||
15 | prev = lc | ||
16 | |||
12 | return result | 17 | return result |
18 | |||
19 | |||
13 | 20 | ||
14 | class LocationCheckIncompatible(object): | 21 | class LocationCheckIncompatible(object): |
15 | def __init__(self, industry_type, distance): | 22 | def __init__(self, industry_type, distance): |