Class PathfindingSystem

All Implemented Interfaces:
Disposable, KryoSerializable

public final class PathfindingSystem extends GameSystem
  • Field Details

    • throwExceptionOnMissingPath

      public boolean throwExceptionOnMissingPath
    • pathfindingNodes

      public Array<HeavyPathNode> pathfindingNodes
  • Constructor Details

    • PathfindingSystem

      public PathfindingSystem()
  • Method Details

    • write

      public void write(Kryo kryo, Output output)
      Specified by:
      write in interface KryoSerializable
      Overrides:
      write in class Registrable
    • read

      public void read(Kryo kryo, Input input)
      Specified by:
      read in interface KryoSerializable
      Overrides:
      read in class Registrable
    • setup

      public void setup()
      Description copied from class: GameSystem
      Performs the initial configuration of the system. At the moment of call, systemProvider already contains all objects of systems.
      Overrides:
      setup in class GameSystem
    • postSetup

      public void postSetup()
      Description copied from class: GameSystem
      Performs the final configuration of the system. At the moment of call, all systems are already loaded and setup(), all listeners are already added.
      Overrides:
      postSetup in class GameSystem
    • postStateRestore

      public void postStateRestore()
      Overrides:
      postStateRestore in class GameSystem
    • isWalkablePlatforms

      public boolean isWalkablePlatforms()
    • canAllEnemiesFindPath

      public boolean canAllEnemiesFindPath()
      Можно временно изменить тайл и вызвать этот метод, чтобы проверить, можно ли так делать.
      Returns:
      true если от каждого спавна к базе есть путь для каждого типа врага, который там спавнится
    • forcePathfindingRebuild

      public void forcePathfindingRebuild()
    • findPathBetweenXY

      @Null public Path findPathBetweenXY(int startX, int startY, int endX, int endY, @Null EnemyType enemy)
    • findPathBetweenTiles

      @Null public Path findPathBetweenTiles(Tile startTile, Tile targetTile)
      Can be called concurrently but do not mix with pathfinding-modifying operations
    • findPathToTargetTile

      @Null public Path findPathToTargetTile(Tile startTile, @Null EnemyType enemyType)
    • getDefaultPathWithoutStateChanges

      public Path getDefaultPathWithoutStateChanges(EnemyType enemyType, SpawnTile spawnTile)
    • rebuildPathfindingIfNeeded

      public void rebuildPathfindingIfNeeded()
    • rebuildPathfinding

      public void rebuildPathfinding()
      Обновляет массивы соединений и присваивает им индексы
      Throws:
      Map.PathNotFoundForEnemyTypeException
    • getEnemyTypesThatCantFindPath

      public Array<Map.EnemyTypeSpawnPair> getEnemyTypesThatCantFindPath()
    • getDefaultPath

      public Path getDefaultPath(EnemyType enemyType, SpawnTile spawnTile)
      Возвращает стандартный кэшированный путь для этого типа врага. Если throwExceptionOnMissingPath == false, вернет null при отсутствующем пути
    • update

      public void update(float deltaTime)
      Overrides:
      update in class GameSystem
    • drawDebug

      public void drawDebug(Batch batch)
    • affectsGameState

      public boolean affectsGameState()
      Specified by:
      affectsGameState in class GameSystem
    • getSystemName

      public String getSystemName()
      Specified by:
      getSystemName in class GameSystem