Class SlipstreamManager

java.lang.Object
com.fs.starfarer.api.impl.campaign.velfield.SlipstreamManager
All Implemented Interfaces:
EveryFrameScript

public class SlipstreamManager extends Object implements EveryFrameScript
  • Field Details

    • WIDTH

      public static int WIDTH
    • HEIGHT

      public static int HEIGHT
    • MAP_WIDTH_PADDING

      public static float MAP_WIDTH_PADDING
    • MAP_HEIGHT_PADDING

      public static float MAP_HEIGHT_PADDING
    • STREAM_CONFIGS

      public static Map<String,Float> STREAM_CONFIGS
      21x11 characters Capital letter: endpoints Lowercase letter, optional: control point for 3-point stream (if 2: cubic bezier curve instead of quadratic) Direction of flow is determined by time of cycle and relative location of endpoints X is ignored; just marks the center to make it easier to edit After a capital letter: < makes the stream go in the opposite-to-standard direction +- adjusts the stream's burn level; 0 means +10 ~ makes the stream narrower, on average = makes it wider | makes it much straighter than usual ! priority, spawned before other streams (and thus other streams will fade when intersecting it, not this one) ^ only keep longest segment - but, from intersections with streams ONLY, not with stars/other blockers * randomize: up to +10 burn, reverse, straightness, wide/narrow ? randomize: same as above, but no reverse and only up to +5 burn
    • grid

      protected transient CollisionGridUtil grid
    • interval

      protected IntervalUtil interval
    • random

      protected Random random
    • prevMonth

      protected int prevMonth
    • desiredNumStreams

      protected int desiredNumStreams
    • active

    • config

    • prevConfig

      protected String prevConfig
  • Constructor Details

    • SlipstreamManager

      public SlipstreamManager()
  • Method Details

    • loadConfigs

      public static void loadConfigs()
    • mirrorPrevVert

      public static void mirrorPrevVert(float weight)
    • mirrorVert

      public static String mirrorVert(String in)
    • mirrorPrevHorz

      public static void mirrorPrevHorz(float weight)
    • mirrorHorz

      public static String mirrorHorz(String in)
    • validateConfigs

      public static void validateConfigs()
    • readResolve

      protected Object readResolve()
    • advance

      public void advance(float amount)
      Description copied from interface: EveryFrameScript
      Use SectorAPI.getClock() to convert to campaign days.
      Specified by:
      advance in interface EveryFrameScript
      Parameters:
      amount - seconds elapsed during the last frame.
    • addStream

      public void addStream(int month)
    • checkIntersectionsAndFadeSections

      public void checkIntersectionsAndFadeSections(SlipstreamTerrainPlugin2 plugin, boolean onlyKeepLongestBetweenStreams)
    • fadeOutSectionsShorterThan

      public static void fadeOutSectionsShorterThan(List<SlipstreamTerrainPlugin2.SlipstreamSegment> segments, float minLength)
    • removedFadesThatDoNotReachZero

      public static void removedFadesThatDoNotReachZero(List<SlipstreamTerrainPlugin2.SlipstreamSegment> segments)
    • getGrid

      public CollisionGridUtil getGrid()
    • updateGrid

      public void updateGrid()
    • isDone

      public boolean isDone()
      Specified by:
      isDone in interface EveryFrameScript
      Returns:
      true when the script is finished and can be cleaned up by the engine.
    • runWhilePaused

      public boolean runWhilePaused()
      Specified by:
      runWhilePaused in interface EveryFrameScript
      Returns:
      whether advance() should be called while the campaign engine is paused.