Despite receiving the era of the campaign as a parameter it does not get used - I assume this means the returned faction will always just be the first value in the starting forces list for that planet? (i.e. usually Era 1).
|
def __getPlanetOwner(self, index: int, planet: str, era: int) -> Faction: |
|
"""Gets the owner of a planet in the GC selected by index and era""" |
|
|
|
try: |
|
sf = self.campaigns[index].startingForces |
|
planet_info = sf.loc[(sf.Planet.str.lower() == planet.lower())] |
|
except KeyError: |
|
return self.__getNeutralFaction() |
|
|
|
try: |
|
faction_name = planet_info.values[0][2] |
|
except IndexError: |
|
return self.__getNeutralFaction() |
|
|
|
return getObject(faction_name, self.repository.factions) |
Despite receiving the era of the campaign as a parameter it does not get used - I assume this means the returned faction will always just be the first value in the starting forces list for that planet? (i.e. usually Era 1).
PyGCEditor/DisplayHelpers.py
Lines 33 to 47 in 878beda