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 class
static final class
static final class
static final class
static final class
static final class
-
Field Summary
FieldsModifier and TypeFieldDescriptionboolean
Fields inherited from class com.prineside.tdi2.Registrable
S
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
Можно временно изменить тайл и вызвать этот метод, чтобы проверить, можно ли так делать.void
findPathBetweenTiles
(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) void
getDefaultPath
(EnemyType enemyType, SpawnTile spawnTile) Возвращает стандартный кэшированный путь для этого типа врага.getDefaultPathWithoutStateChanges
(EnemyType enemyType, SpawnTile spawnTile) boolean
void
Performs the final configuration of the system.void
void
void
Обновляет массивы соединений и присваивает им индексыvoid
void
setup()
Performs the initial configuration of the system.void
update
(float deltaTime) void
Methods inherited from class com.prineside.tdi2.GameSystem
dispose, getFastStateHash, profileUpdate
Methods 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:
write
in interfaceKryoSerializable
- Overrides:
write
in classRegistrable
-
read
- Specified by:
read
in interfaceKryoSerializable
- Overrides:
read
in classRegistrable
-
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 classGameSystem
-
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 classGameSystem
-
postStateRestore
public void postStateRestore()- Overrides:
postStateRestore
in 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:
update
in classGameSystem
-
drawDebug
-
affectsGameState
public boolean affectsGameState()- Specified by:
affectsGameState
in classGameSystem
-
getSystemName
- Specified by:
getSystemName
in classGameSystem
-