MCPcopy Index your code
hub / github.com/pyfa-org/Pyfa / getCycleParameters

Method getCycleParameters

eos/saveddata/module.py:968–1023  ·  view source on GitHub ↗

Copied from new eos as well

(self, reloadOverride=None)

Source from the content-addressed store, hash-verified

966 return self.getCycleParameters(reloadOverride=reloadOverride)
967
968 def getCycleParameters(self, reloadOverride=None):
969 """Copied from new eos as well"""
970 # Determine if we'll take into account reload time or not
971 if reloadOverride is not None:
972 factorReload = reloadOverride
973 else:
974 factorReload = self.owner.factorReload if self.forceReload is None else self.forceReload
975
976 cycles_until_reload = self.numShots
977 if cycles_until_reload == 0:
978 cycles_until_reload = math.inf
979
980 active_time = self.rawCycleTime
981 if active_time == 0:
982 return None
983 forced_inactive_time = self.reactivationDelay
984 reload_time = self.reloadTime
985 # Effects which cannot be reloaded have the same processing whether
986 # caller wants to take reload time into account or not
987 if reload_time is None and cycles_until_reload < math.inf:
988 final_cycles = 1
989 early_cycles = cycles_until_reload - final_cycles
990 # Single cycle until effect cannot run anymore
991 if early_cycles == 0:
992 return CycleInfo(active_time, 0, 1, False)
993 # Multiple cycles with the same parameters
994 if forced_inactive_time == 0:
995 return CycleInfo(active_time, 0, cycles_until_reload, False)
996 # Multiple cycles with different parameters
997 return CycleSequence((
998 CycleInfo(active_time, forced_inactive_time, early_cycles, False),
999 CycleInfo(active_time, 0, final_cycles, False)
1000 ), 1)
1001 # Module cycles the same way all the time in 3 cases:
1002 # 1) caller doesn't want to take into account reload time
1003 # 2) effect does not have to reload anything to keep running
1004 # 3) effect has enough time to reload during inactivity periods
1005 if (
1006 not factorReload or
1007 cycles_until_reload == math.inf or
1008 forced_inactive_time >= reload_time
1009 ):
1010 isInactivityReload = factorReload and forced_inactive_time >= reload_time
1011 return CycleInfo(active_time, forced_inactive_time, math.inf, isInactivityReload)
1012 # We've got to take reload into consideration
1013 else:
1014 final_cycles = 1
1015 early_cycles = cycles_until_reload - final_cycles
1016 # If effect has to reload after each its cycle, then its parameters
1017 # are the same all the time
1018 if early_cycles == 0:
1019 return CycleInfo(active_time, reload_time, math.inf, True)
1020 return CycleSequence((
1021 CycleInfo(active_time, forced_inactive_time, early_cycles, False),
1022 CycleInfo(active_time, reload_time, final_cycles, True)
1023 ), math.inf)
1024
1025 @property

Callers 5

__calculateMiningMethod · 0.95
getDpsMethod · 0.95
getRemoteRepsMethod · 0.95
capUseMethod · 0.95

Calls 2

CycleInfoClass · 0.90
CycleSequenceClass · 0.90

Tested by

no test coverage detected