Class MapSystem

All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable, com.esotericsoftware.kryo.KryoSerializable

public final class MapSystem extends GameSystem
  • Field Details

    • TOWER_RANGE_SELECTED_COLOR

      public static final com.badlogic.gdx.graphics.Color TOWER_RANGE_SELECTED_COLOR
    • TOWER_RANGE_HOVER_COLOR

      public static final com.badlogic.gdx.graphics.Color TOWER_RANGE_HOVER_COLOR
    • drawPathTraces

      public boolean drawPathTraces
    • spawnedEnemies

      public com.badlogic.gdx.utils.DelayedRemovalArray<Enemy.EnemyReference> spawnedEnemies
    • spawnedUnits

      public com.badlogic.gdx.utils.DelayedRemovalArray<Unit> spawnedUnits
  • Constructor Details

    • MapSystem

      public MapSystem()
  • Method Details

    • write

      public void write(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Output output)
      Specified by:
      write in interface com.esotericsoftware.kryo.KryoSerializable
      Overrides:
      write in class Registrable
    • read

      public void read(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input)
      Specified by:
      read in interface com.esotericsoftware.kryo.KryoSerializable
      Overrides:
      read in class Registrable
    • affectsGameState

      public boolean affectsGameState()
      Specified by:
      affectsGameState in class GameSystem
    • getMap

      public Map getMap()
    • getTileAndNeighbours

      public void getTileAndNeighbours(int x, int y, com.badlogic.gdx.utils.Array<Tile> out)
      Получить тайл и соседей (по углам тоже)
    • setMap

      public void setMap(Map map)
    • setMapSize

      public void setMapSize(int width, int height)
    • getDirtyTileGeneration

      public short getDirtyTileGeneration(Tile tile)
    • getDirtyTileGeneration

      public short getDirtyTileGeneration(int x, int y)
    • updateDirtyTiles

      public void updateDirtyTiles()
    • markAllTilesDirty

      public void markAllTilesDirty()
    • markTilesDirty

      public void markTilesDirty(Tile tile, int range)
    • markTilesDirty

      public void markTilesDirty(int x, int y, int range)
      Parameters:
      range - >= 0. If 0, a single tile will be marked dirty
    • getEnemiesInRect

      public void getEnemiesInRect(float minX, float minY, float maxX, float maxY, AABB.EntryRetriever<Enemy.EnemyReference> cb)
      Parameters:
      cb - returns true to continue iteration and false to stop it
    • getEnemiesInRect

      public void getEnemiesInRect(float minX, float minY, float maxX, float maxY, AABB.EntryFilter filter, AABB.EntryRetriever<Enemy.EnemyReference> cb)
    • getEnemiesInRect

      public void getEnemiesInRect(com.badlogic.gdx.math.Vector2 v1, com.badlogic.gdx.math.Vector2 v2, AABB.EntryRetriever<Enemy.EnemyReference> cb)
    • getEnemiesInCircle

      public void getEnemiesInCircle(float centerX, float centerY, float radiusInPixels, AABB.EntryFilter filter, AABB.EntryRetriever<Enemy.EnemyReference> cb)
      Note: enemy never null (if not modified during the loop)
    • getEnemiesInCircle

      public void getEnemiesInCircle(float centerX, float centerY, float radiusInPixels, AABB.EntryRetriever<Enemy.EnemyReference> cb)
    • getEnemiesInCircle

      public void getEnemiesInCircle(com.badlogic.gdx.math.Vector2 pos, float radiusInPixels, AABB.EntryRetriever<Enemy.EnemyReference> cb)
    • setup

      public void setup()
      Description copied from class: GameSystem
      Произвести начальную настройку системы. На момент вызова этого метода, systemProvider содержит объекты всех систем.
      Overrides:
      setup in class GameSystem
    • postStateRestore

      public void postStateRestore()
      Overrides:
      postStateRestore in class GameSystem
    • postSetup

      public void postSetup()
      Description copied from class: GameSystem
      Произвести окончательную настройку системы. Во время вызова, все системы загружены и установлены (setup()), все слушатели добавлены
      Overrides:
      postSetup in class GameSystem
    • showTileWarningParticle

      public void showTileWarningParticle(int x, int y)
    • removeHighlights

      public void removeHighlights()
    • highlightTile

      public void highlightTile(Tile tile)
    • highlightGate

      public void highlightGate(Gate gate)
    • isPointWithinTile

      public boolean isPointWithinTile(Tile tile, int x, int y)
    • isVisible

      public boolean isVisible(Tile tile, com.badlogic.gdx.graphics.OrthographicCamera camera)
    • setGate

      public void setGate(int x, int y, boolean leftSide, Gate gate)
      Изменить гейт во время игры
    • setTile

      public void setTile(int x, int y, Tile tile)
      Изменить тайл во время игры TODO trigger an event instead and move all tower/miner/tile related logic there
    • registerTile

      public void registerTile(Tile tile)
      Напрямую внести тайл в регистр системы. Вызывать при добавлении тайла на карту
    • unregisterTile

      public void unregisterTile(Tile tile)
      Напрямую вывести тайл из регистра. Вызывать при удалении тайла из карты
    • registerGate

      public void registerGate(Gate gate)
    • unregisterGate

      public void unregisterGate(Gate gate)
    • setTower

      public void setTower(int x, int y, Tower tower)
    • setModifier

      public void setModifier(int x, int y, Modifier modifier)
    • removeBuilding

      public void removeBuilding(Building building)
    • setMiner

      public void setMiner(int x, int y, Miner miner)
    • removeMiner

      public void removeMiner(Miner miner)
    • isSpawned

      public boolean isSpawned(Unit unit)
    • spawnEnemy

      public void spawnEnemy(Enemy enemy)
      Заспавнить врага на карте. Враг будет просто учитываться системой, но не получит сразу путь и позицию на карте - использовать эти данные можно только если enemy.setUpByEnemySystem
    • spawnUnit

      public void spawnUnit(Unit unit)
    • lineCanHitEntry

      public boolean lineCanHitEntry(float x1, float y1, float x2, float y2)
    • rayCastEnemiesSorted

      public boolean rayCastEnemiesSorted(float startX, float startY, float endX, float endY, float rayThickness, ObjectFilter<Enemy.EnemyReference> cb)
    • rayCastEnemies

      public boolean rayCastEnemies(float startX, float startY, float endX, float endY, float rayThickness, ObjectFilter<Enemy.EnemyReference> cb)
    • getSpawnedEnemiesCountByWave

      public int getSpawnedEnemiesCountByWave(Wave wave)
    • showTowerRangeHint

      public void showTowerRangeHint(float x, float y, float minRadius, float maxRadius)
    • hideTowerRangeHint

      public void hideTowerRangeHint()
    • upgradeCoreAction

      public void upgradeCoreAction(CoreTile coreTile, int col, int row)
    • upgradeCoreAction

      public void upgradeCoreAction(int coreX, int coreY, int col, int row)
    • upgradeCore

      public boolean upgradeCore(int coreX, int coreY, int col, int row)
    • upgradeCore

      public boolean upgradeCore(CoreTile coreTile, int col, int row)
      Установить улучшение ядра
    • update

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

      public boolean profileUpdate()
      Description copied from class: GameSystem
      Нужно ли учитывать время выполнения update() в Debug
      Overrides:
      profileUpdate in class GameSystem
    • getSystemName

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

      public void setPathTracesDrawing(boolean drawing)
      Используется в Lua
    • traverseNeighbourTiles

      public void traverseNeighbourTiles(int x, int y, ObjectFilter<Tile> cb)
      Parameters:
      cb - should return false to stop the loop
    • traverseNeighbourTiles

      public void traverseNeighbourTiles(Tile tile, ObjectFilter<Tile> cb)
    • traverseNeighbourTilesAndThis

      public void traverseNeighbourTilesAndThis(int x, int y, ObjectFilter<Tile> cb)
      Parameters:
      cb - should return false to stop the loop
    • traverseNeighbourTilesAndThis

      public void traverseNeighbourTilesAndThis(Tile tile, ObjectFilter<Tile> cb)
    • drawBatch

      public void drawBatch(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 interface com.badlogic.gdx.utils.Disposable
      Overrides:
      dispose in class GameSystem