MCPcopy Create free account
hub / github.com/pyfa-org/Pyfa / race

Method race

eos/gamedata.py:352–398  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

350
351 @property
352 def race(self):
353 if self.__race is None:
354
355 try:
356 if self.category.name == 'Structure':
357 self.__race = "upwell"
358 else:
359 self.__race = self.factionMap[self.factionID]
360 # Some ships (like few limited issue ships) do not have factionID set,
361 # thus keep old mechanism for now
362 except KeyError:
363 # Define race map
364 map = {
365 1 : "caldari",
366 2 : "minmatar",
367 4 : "amarr",
368 5 : "sansha", # Caldari + Amarr
369 6 : "blood", # Minmatar + Amarr
370 8 : "gallente",
371 9 : "guristas", # Caldari + Gallente
372 10 : "angelserp", # Minmatar + Gallente, final race depends on the order of skills
373 12 : "sisters", # Amarr + Gallente
374 15 : "concord",
375 16 : "jove",
376 32 : "sansha", # Incrusion Sansha
377 128: "ore",
378 135: "triglavian",
379 168: "upwell",
380 }
381 # Race is None by default
382 race = None
383 # Check primary and secondary required skills' races
384 if race is None:
385 skillRaces = tuple([rid for rid in (s.raceID for s in tuple(self.requiredSkills.keys())) if rid])
386 if sum(skillRaces) in map:
387 race = map[sum(skillRaces)]
388 if race == "angelserp":
389 if skillRaces == (2, 8):
390 race = "angel"
391 else:
392 race = "serpentis"
393 # Rely on item's own raceID as last resort
394 if race is None:
395 race = map.get(self.raceID, None)
396 # Store our final value
397 self.__race = race
398 return self.__race
399
400 @property
401 def assistive(self):

Callers

nothing calls this directly

Calls 2

keysMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected