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:
com.badlogic.gdx.utils.Disposable
,com.esotericsoftware.kryo.KryoSerializable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static class
static interface
-
Field Summary
FieldsModifier and TypeFieldDescriptionfloat[][]
com.badlogic.gdx.graphics.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[][]
com.badlogic.gdx.graphics.g2d.TextureRegion[]
com.badlogic.gdx.graphics.g2d.TextureRegion[]
boolean[][]
com.badlogic.gdx.graphics.g2d.TextureRegion[]
boolean[]
float
static final int
static final int
Fields inherited from class com.prineside.tdi2.Registrable
S
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Добавить врага в текущую волну У врага будет рандомно установлен спавнvoid
void
void
addStaticEnemy
(Enemy enemy, float x, float y) boolean
void
despawnEnemy
(Enemy enemy) void
dispose()
Releases all resources of this object.void
draw
(com.badlogic.gdx.graphics.g2d.Batch batch, float deltaTime, float interpolatedTime) void
drawEnemyHealth
(com.badlogic.gdx.graphics.g2d.Batch batch, float deltaTime) com.badlogic.gdx.graphics.Color
Per-session value of Enemy.Factory#get...()com.badlogic.gdx.graphics.g2d.TextureRegion
getEmojiTexture
(EnemyType enemyType) Per-session value of Enemy.Factory#get...()com.badlogic.gdx.graphics.g2d.TextureRegion
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.com.badlogic.gdx.graphics.g2d.TextureRegion
getTexture
(EnemyType enemyType) Per-session value of Enemy.Factory#get...()double
boolean
giveDamage
(Enemy enemy, Tower tower, float damage, DamageType damageType, Ability ability, boolean cleanForDps, Projectile projectile) boolean
void
killEnemy
(Enemy enemy, Tower killer, DamageType damageType, Ability ability, Projectile projectile) void
Произвести окончательную настройку системы.void
void
Обновить пути всех врагов.void
read
(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input) void
void
void
void
setup()
Произвести начальную настройку системы.void
update
(float deltaTime) void
write
(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Output output) 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
public com.badlogic.gdx.graphics.Color[] enemyColorCan 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
public com.badlogic.gdx.graphics.g2d.TextureRegion[] enemyTexture -
enemyHighlightTexture
public com.badlogic.gdx.graphics.g2d.TextureRegion[] enemyHighlightTexture -
enemyEmojiTexture
public com.badlogic.gdx.graphics.g2d.TextureRegion[] enemyEmojiTexture -
enemyDamageVulnerability
public boolean[][] enemyDamageVulnerability -
enemySpecialDamageVulnerability
public boolean[][] enemySpecialDamageVulnerability -
enemyBuffVulnerability
public float[][] enemyBuffVulnerability -
lastDamageGiven
public float lastDamageGiven -
listeners
-
-
Constructor Details
-
EnemySystem
public EnemySystem()
-
-
Method Details
-
write
public void write(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Output output) - Specified by:
write
in interfacecom.esotericsoftware.kryo.KryoSerializable
- Overrides:
write
in classRegistrable
-
read
public void read(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input) - Specified by:
read
in interfacecom.esotericsoftware.kryo.KryoSerializable
- Overrides:
read
in classRegistrable
-
affectsGameState
public boolean affectsGameState()- Specified by:
affectsGameState
in classGameSystem
-
setup
public void setup()Description copied from class:GameSystem
Произвести начальную настройку системы. На момент вызова этого метода, systemProvider содержит объекты всех систем.- Overrides:
setup
in classGameSystem
-
postSetup
public void postSetup()Description copied from class:GameSystem
Произвести окончательную настройку системы. Во время вызова, все системы загружены и установлены (setup()), все слушатели добавлены- Overrides:
postSetup
in classGameSystem
-
postStateRestore
public void postStateRestore()- Overrides:
postStateRestore
in classGameSystem
-
register
-
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
-
register
-
register
-
giveDamage
public boolean giveDamage(Enemy enemy, Tower tower, float damage, DamageType damageType, Ability ability, boolean cleanForDps, Projectile projectile) - Parameters:
cleanForDps
- true, если чистый урон башни, который будет учитываться в dps (например, killshot не учитывается)- Returns:
- true, если убили. Рекомендуется очищать переменную enemy, если врага убили, чтобы не обращаться к невалидному объекту дальше в текущей функции
-
getTowersMaxDps
public double getTowersMaxDps()- Returns:
- максимальный урон в секунду от всех башен
-
despawnEnemy
-
killEnemy
public void killEnemy(Enemy enemy, Tower killer, DamageType damageType, Ability ability, Projectile projectile) -
queueAllEnemiesPathfinding
public void queueAllEnemiesPathfinding()Обновить пути всех врагов. Полезно в случае, если сменилась конфигурация карты. -
addEnemy
Добавить врага в текущую волну У врага будет рандомно установлен спавн- Parameters:
sideShift
- -1 - рандомно, Path.MIDDLE_SIDE_SHIFT - посредине и тд
-
addStaticEnemy
-
addEnemy
-
addEnemy
-
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
public void draw(com.badlogic.gdx.graphics.g2d.Batch batch, float deltaTime, float interpolatedTime) -
drawEnemyHealth
public void drawEnemyHealth(com.badlogic.gdx.graphics.g2d.Batch batch, float deltaTime) -
dispose
public void dispose()Description copied from interface:com.badlogic.gdx.utils.Disposable
Releases all resources of this object.- Specified by:
dispose
in interfacecom.badlogic.gdx.utils.Disposable
- Overrides:
dispose
in classGameSystem
-