Class WarpJumpManager

java.lang.Object
me.iron.WarpSpace.Mod.WarpJumpManager

public class WarpJumpManager
extends java.lang.Object
handles all jumps happening and related methods like checking for interdiction etc.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static java.util.List<org.schema.game.common.controller.SegmentController> dropQueue  
    static java.util.List<org.schema.game.common.controller.SegmentController> entryQueue  
  • Constructor Summary

    Constructors 
    Constructor Description
    WarpJumpManager()  
  • Method Summary

    Modifier and Type Method Description
    static boolean canExecuteWarpdrive​(org.schema.game.common.controller.SegmentController ship)  
    static void doSectorSwitch​(org.schema.game.common.controller.SegmentController ship, org.schema.common.util.linAlg.Vector3i newPos, boolean instant)  
    static void emptyWarpdrive​(org.schema.game.common.controller.SegmentController ship)
    will remove one jump charge from the FTL drive of the specified ship.
    private static org.schema.common.util.linAlg.Vector3i getRandomSector()
    get a random sector in a 500 x 100 x 500 radius
    static void invokeDrop​(long countdown, org.schema.game.common.controller.SegmentController ship, org.schema.common.util.linAlg.Vector3i sector, boolean isJump, boolean force)
    will drop the given ship out of warp after x seconds to specified sector.
    static void invokeEntry​(long countdown, org.schema.game.common.controller.SegmentController ship, org.schema.common.util.linAlg.Vector3i sector, boolean force)
    will make the given ship entry warp after x seconds to specified sector.
    static boolean isAllowedDropJump​(org.schema.game.common.controller.SegmentController ship)
    Check if a ship is allowed to drop out of warp checks interdiction checks warpdrive.canExecute
    static boolean isAllowedEntry​(org.schema.game.common.controller.SegmentController ship)
    Check if a ship is allowed to enter the warp
    static boolean isInterdicted​(org.schema.game.common.controller.SegmentController ship)
    check if ship is interdicted at its current position
    static boolean isInterdicted​(org.schema.game.common.controller.SegmentController ship, org.schema.common.util.linAlg.Vector3i position)
    check if this ship is/would be interdicted at specified position.
    static void SendPlayerWarpSituation​(org.schema.game.common.controller.SegmentController sc, WarpProcessController.WarpProcess process, java.lang.Integer processValue, java.util.List<java.lang.String> processArray)
    send HUD update to all clients of attached players of this segmentcontroller
    static void SendPlayerWarpSituation​(org.schema.game.common.data.player.PlayerState p, WarpProcessController.WarpProcess s, java.lang.Integer v, java.util.List<java.lang.String> processArray)
    send hud update to specific player client computer

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • dropQueue

      public static java.util.List<org.schema.game.common.controller.SegmentController> dropQueue
    • entryQueue

      public static java.util.List<org.schema.game.common.controller.SegmentController> entryQueue
  • Constructor Details

  • Method Details

    • invokeDrop

      public static void invokeDrop​(long countdown, org.schema.game.common.controller.SegmentController ship, org.schema.common.util.linAlg.Vector3i sector, boolean isJump, boolean force)
      will drop the given ship out of warp after x seconds to specified sector. will not check if ship is allowed to drop, only if it already has a drop queued. Automatically handles effects etc.
      Parameters:
      countdown - do jump in x second
      ship - ship to warp
      sector - targeted sector to drop into
      isJump - is a jump or an autodrop, will empty warpdrive if true
      force - overwrite all checks, admin
    • invokeEntry

      public static void invokeEntry​(long countdown, org.schema.game.common.controller.SegmentController ship, org.schema.common.util.linAlg.Vector3i sector, boolean force)
      will make the given ship entry warp after x seconds to specified sector.
      Parameters:
      countdown - in seconds
      ship - segmentcontroller
      sector - target sector to enter
      force - true if ignore all checks and force jump anyways
    • getRandomSector

      private static org.schema.common.util.linAlg.Vector3i getRandomSector()
      get a random sector in a 500 x 100 x 500 radius
      Returns:
      random pos Vector3i
    • doSectorSwitch

      public static void doSectorSwitch​(org.schema.game.common.controller.SegmentController ship, org.schema.common.util.linAlg.Vector3i newPos, boolean instant)
    • isAllowedEntry

      public static boolean isAllowedEntry​(org.schema.game.common.controller.SegmentController ship)
      Check if a ship is allowed to enter the warp
      Parameters:
      ship - segmentcontroller to check
      Returns:
      boolean, true if allowed entry, false if interdicted or can fire warpdrive
    • isAllowedDropJump

      public static boolean isAllowedDropJump​(org.schema.game.common.controller.SegmentController ship)
      Check if a ship is allowed to drop out of warp checks interdiction checks warpdrive.canExecute
      Parameters:
      ship - segmentcontroller ship
      Returns:
      boolean, true if not interdicted and can fire warpdrive
    • emptyWarpdrive

      public static void emptyWarpdrive​(org.schema.game.common.controller.SegmentController ship)
      will remove one jump charge from the FTL drive of the specified ship.
      Parameters:
      ship - ship segmentcontroller
    • canExecuteWarpdrive

      public static boolean canExecuteWarpdrive​(org.schema.game.common.controller.SegmentController ship)
    • isInterdicted

      public static boolean isInterdicted​(org.schema.game.common.controller.SegmentController ship, org.schema.common.util.linAlg.Vector3i position)
      check if this ship is/would be interdicted at specified position.
      Parameters:
      ship - ship
      position - positon to check from
      Returns:
      true if interdicted
    • isInterdicted

      public static boolean isInterdicted​(org.schema.game.common.controller.SegmentController ship)
      check if ship is interdicted at its current position
      Parameters:
      ship - ship to check for
      Returns:
      true if is interdicted
    • SendPlayerWarpSituation

      public static void SendPlayerWarpSituation​(org.schema.game.common.data.player.PlayerState p, WarpProcessController.WarpProcess s, java.lang.Integer v, java.util.List<java.lang.String> processArray)
      send hud update to specific player client computer
      Parameters:
      p - playerstate player
      s - process thats happening
      v - value of process
      processArray - extra info, not used atm
    • SendPlayerWarpSituation

      public static void SendPlayerWarpSituation​(org.schema.game.common.controller.SegmentController sc, WarpProcessController.WarpProcess process, java.lang.Integer processValue, java.util.List<java.lang.String> processArray)
      send HUD update to all clients of attached players of this segmentcontroller
      Parameters:
      sc - ship
      process - warpprocess
      processValue - value of warpprocess (0 = off, 1 = on)
      processArray - extra info, not used atm