Class EnemySystem

All Implemented Interfaces:
Disposable, KryoSerializable

public final class EnemySystem extends GameSystem
  • 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 Color[] 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

      public TextureRegion[] enemyTexture
    • enemyHighlightTexture

      public TextureRegion[] enemyHighlightTexture
    • enemyEmojiTexture

      public TextureRegion[] enemyEmojiTexture
    • enemyDamageVulnerability

      public boolean[][] enemyDamageVulnerability
    • enemySpecialDamageVulnerability

      public boolean[][] enemySpecialDamageVulnerability
    • enemyBuffVulnerability

      public float[][] enemyBuffVulnerability
  • Constructor Details

    • EnemySystem

      public EnemySystem()
  • 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
    • affectsGameState

      public boolean affectsGameState()
      Specified by:
      affectsGameState in class GameSystem
    • 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
    • registerWithRandomSideShift

      public void registerWithRandomSideShift(Enemy enemy)
    • getReference

      public Enemy.EnemyReference getReference(Enemy enemy)
      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

      public void registerWithSideShift(Enemy enemy, int sideShiftIndex)
    • registerWithPath

      public void registerWithPath(Enemy enemy, @Null Path path, int sideShiftIndex, float passedTiles)
    • queueAllEnemiesPathfinding

      public void queueAllEnemiesPathfinding()
      Обновить пути всех врагов. Полезно в случае, если сменилась конфигурация карты.
    • addEnemyWithFirstSpawn

      public void addEnemyWithFirstSpawn(Enemy enemy, Tile tile, int sideShift)
      Добавить врага в текущую волну У врага будет рандомно установлен спавн
      Parameters:
      sideShift - -1 - рандомно, Path.MIDDLE_SIDE_SHIFT - посредине и тд
    • addStaticEnemy

      public void addStaticEnemy(Enemy enemy, float x, float y)
    • addEnemy

      public void addEnemy(Enemy enemy, SpawnTile spawnTile, int sideShift, Wave wave, float passedTiles)
    • addEnemyWithPath

      public void addEnemyWithPath(Enemy enemy, @Null SpawnTile spawnTile, @Null Path path, int sideShift, @Null Wave wave, float passedTiles)
    • update

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

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

      public boolean isEmojiEnemies()
    • getColor

      public Color getColor(EnemyType enemyType)
      Per-session value of Enemy.Factory#get...()
    • getTexture

      public TextureRegion getTexture(EnemyType enemyType)
      Per-session value of Enemy.Factory#get...()
    • getHighlightTexture

      public TextureRegion getHighlightTexture(EnemyType enemyType)
      Per-session value of Enemy.Factory#get...()
    • getEmojiTexture

      public TextureRegion getEmojiTexture(EnemyType enemyType)
      Per-session value of Enemy.Factory#get...()
    • draw

      public void draw(Batch batch, float deltaTime, float interpolatedTime)
    • drawEnemyHealth

      public void drawEnemyHealth(Batch batch)
    • dispose

      public void dispose()
      Description copied from interface: com.badlogic.gdx.utils.Disposable
      Releases all resources of this object.
      Specified by:
      dispose in interface Disposable
      Overrides:
      dispose in class GameSystem