Package com.prineside.tdi2.systems
Class EnemySystem
java.lang.Object
com.prineside.tdi2.Registrable
com.prineside.tdi2.GameSystem
com.prineside.tdi2.systems.EnemySystem
- All Implemented Interfaces:
Disposable
,KryoSerializable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionfloat[][]
Color[]
Can be changed in runtime, per-session copy of values taken from Enemy.Factory Must be updated on state restore as assets are not stored in replayboolean[][]
boolean[][]
boolean[]
static final int
static final int
Fields inherited from class com.prineside.tdi2.Registrable
S
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
addEnemyWithFirstSpawn
(Enemy enemy, Tile tile, int sideShift) Добавить врага в текущую волну У врага будет рандомно установлен спавнvoid
addEnemyWithPath
(Enemy enemy, SpawnTile spawnTile, Path path, int sideShift, Wave wave, float passedTiles) void
addStaticEnemy
(Enemy enemy, float x, float y) boolean
void
dispose()
Releases all resources of this object.void
void
drawEnemyHealth
(Batch batch) Per-session value of Enemy.Factory#get...()getEmojiTexture
(EnemyType enemyType) Per-session value of Enemy.Factory#get...()getHighlightTexture
(EnemyType enemyType) Per-session value of Enemy.Factory#get...()getReference
(Enemy enemy) Use this method if you need to store a reference to Enemy anywhere.getTexture
(EnemyType enemyType) Per-session value of Enemy.Factory#get...()boolean
void
Performs the final configuration of the system.void
void
Обновить пути всех врагов.void
void
registerWithPath
(Enemy enemy, Path path, int sideShiftIndex, float passedTiles) void
registerWithRandomSideShift
(Enemy enemy) void
registerWithSideShift
(Enemy enemy, int sideShiftIndex) void
setup()
Performs the initial configuration of the system.void
update
(float deltaTime) void
Methods inherited from class com.prineside.tdi2.GameSystem
getFastStateHash, profileUpdate
Methods inherited from class com.prineside.tdi2.Registrable
isRegistered, setRegistered, setUnregistered
-
Field Details
-
RANDOM_SIDE_SHIFT
public static final int RANDOM_SIDE_SHIFT- See Also:
-
MIDDLE_SIDE_SHIFT
public static final int MIDDLE_SIDE_SHIFT- See Also:
-
flyingEnemy
public boolean[] flyingEnemy -
enemyColor
Can be changed in runtime, per-session copy of values taken from Enemy.Factory Must be updated on state restore as assets are not stored in replay -
enemyTexture
-
enemyHighlightTexture
-
enemyEmojiTexture
-
enemyDamageVulnerability
public boolean[][] enemyDamageVulnerability -
enemySpecialDamageVulnerability
public boolean[][] enemySpecialDamageVulnerability -
enemyBuffVulnerability
public float[][] enemyBuffVulnerability
-
-
Constructor Details
-
EnemySystem
public EnemySystem()
-
-
Method Details
-
write
- Specified by:
write
in interfaceKryoSerializable
- Overrides:
write
in classRegistrable
-
read
- Specified by:
read
in interfaceKryoSerializable
- Overrides:
read
in classRegistrable
-
affectsGameState
public boolean affectsGameState()- Specified by:
affectsGameState
in classGameSystem
-
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
-
registerWithRandomSideShift
-
getReference
Use this method if you need to store a reference to Enemy anywhere.- Returns:
- managed wrap for Enemy which will become empty as soon as Enemy becomes unregistered
-
registerWithSideShift
-
registerWithPath
-
queueAllEnemiesPathfinding
public void queueAllEnemiesPathfinding()Обновить пути всех врагов. Полезно в случае, если сменилась конфигурация карты. -
addEnemyWithFirstSpawn
Добавить врага в текущую волну У врага будет рандомно установлен спавн- Parameters:
sideShift
- -1 - рандомно, Path.MIDDLE_SIDE_SHIFT - посредине и тд
-
addStaticEnemy
-
addEnemy
-
addEnemyWithPath
-
update
public void update(float deltaTime) - Overrides:
update
in classGameSystem
-
getSystemName
- Specified by:
getSystemName
in classGameSystem
-
isEmojiEnemies
public boolean isEmojiEnemies() -
getColor
Per-session value of Enemy.Factory#get...() -
getTexture
Per-session value of Enemy.Factory#get...() -
getHighlightTexture
Per-session value of Enemy.Factory#get...() -
getEmojiTexture
Per-session value of Enemy.Factory#get...() -
draw
-
drawEnemyHealth
-
dispose
public void dispose()Description copied from interface:com.badlogic.gdx.utils.Disposable
Releases all resources of this object.- Specified by:
dispose
in interfaceDisposable
- Overrides:
dispose
in classGameSystem
-