Skip to content

__getPlanetOwner does not actually take campaign era into account #89

@Slornie

Description

@Slornie

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions