Package com.prineside.tdi2.systems
Class PathfindingSystem
java.lang.Object
com.prineside.tdi2.Registrable
com.prineside.tdi2.GameSystem
com.prineside.tdi2.systems.PathfindingSystem
- All Implemented Interfaces:
Disposable,KryoSerializable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic final classstatic final classstatic final classstatic final classstatic final class -
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanFields inherited from class com.prineside.tdi2.Registrable
S -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanМожно временно изменить тайл и вызвать этот метод, чтобы проверить, можно ли так делать.voidfindPathBetweenTiles(Tile startTile, Tile targetTile) Can be called concurrently but do not mix with pathfinding-modifying operationsfindPathBetweenXY(int startX, int startY, int endX, int endY, EnemyType enemy) findPathToTargetTile(Tile startTile, EnemyType enemyType) voidgetDefaultPath(EnemyType enemyType, SpawnTile spawnTile) Возвращает стандартный кэшированный путь для этого типа врага.getDefaultPathWithoutStateChanges(EnemyType enemyType, SpawnTile spawnTile) booleanvoidPerforms the final configuration of the system.voidvoidvoidОбновляет массивы соединений и присваивает им индексыvoidvoidsetup()Performs the initial configuration of the system.voidupdate(float deltaTime) voidMethods inherited from class com.prineside.tdi2.GameSystem
dispose, getFastStateHash, profileUpdateMethods inherited from class com.prineside.tdi2.Registrable
isRegistered, setRegistered, setUnregistered
-
Field Details
-
throwExceptionOnMissingPath
public boolean throwExceptionOnMissingPath -
pathfindingNodes
-
-
Constructor Details
-
PathfindingSystem
public PathfindingSystem()
-
-
Method Details
-
write
- Specified by:
writein interfaceKryoSerializable- Overrides:
writein classRegistrable
-
read
- Specified by:
readin interfaceKryoSerializable- Overrides:
readin classRegistrable
-
setup
public void setup()Description copied from class:GameSystemPerforms the initial configuration of the system. At the moment of call, systemProvider already contains all objects of systems.- Overrides:
setupin classGameSystem
-
postSetup
public void postSetup()Description copied from class:GameSystemPerforms the final configuration of the system. At the moment of call, all systems are already loaded and setup(), all listeners are already added.- Overrides:
postSetupin classGameSystem
-
postStateRestore
public void postStateRestore()- Overrides:
postStateRestorein classGameSystem
-
isWalkablePlatforms
public boolean isWalkablePlatforms() -
canAllEnemiesFindPath
public boolean canAllEnemiesFindPath()Можно временно изменить тайл и вызвать этот метод, чтобы проверить, можно ли так делать.- Returns:
- true если от каждого спавна к базе есть путь для каждого типа врага, который там спавнится
-
forcePathfindingRebuild
public void forcePathfindingRebuild() -
findPathBetweenXY
-
findPathBetweenTiles
Can be called concurrently but do not mix with pathfinding-modifying operations -
findPathToTargetTile
-
getDefaultPathWithoutStateChanges
-
rebuildPathfindingIfNeeded
public void rebuildPathfindingIfNeeded() -
rebuildPathfinding
public void rebuildPathfinding()Обновляет массивы соединений и присваивает им индексы -
getEnemyTypesThatCantFindPath
-
getDefaultPath
Возвращает стандартный кэшированный путь для этого типа врага. Если throwExceptionOnMissingPath == false, вернет null при отсутствующем пути -
update
public void update(float deltaTime) - Overrides:
updatein classGameSystem
-
drawDebug
-
affectsGameState
public boolean affectsGameState()- Specified by:
affectsGameStatein classGameSystem
-
getSystemName
- Specified by:
getSystemNamein classGameSystem
-