generator
Procs | |
draw_power | Draws power. If there isn't enough energy to sustain the draw, draw from connected generators, up to 3 generators away. We never do a 180, so at most we should be going around 270 degrees, and never loop. |
---|---|
find_containment_gens | Gets a list of generators that form a field that is enclosing a given singularity, if such a field exists. |
spread_energy | Sends energy to every neighbour that has less energy |
Proc Details
draw_power
Draws power. If there isn't enough energy to sustain the draw, draw from connected generators, up to 3 generators away. We never do a 180, so at most we should be going around 270 degrees, and never loop.
Arguments:
- draw - Amount of energy needed to sustain powerdraw during this cycle
- failsafe - Current depth of the recursion. We don't let this go above 3.
- last - should be src of the previous call, we check against this to prevent going back and forth between two field generators.
find_containment_gens
Gets a list of generators that form a field that is enclosing a given singularity, if such a field exists.
Arguments:
- _dir - The direction in which we are currently going
- singulo - The singularity we are looking to contain
- containment_gens - A list of generators which is the portion of the potential result we have so far.
spread_energy
Sends energy to every neighbour that has less energy