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
    • listeners

  • 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)
    • getEnemiesAABB

      public void getEnemiesAABB(com.badlogic.gdx.math.Vector2 v1, com.badlogic.gdx.math.Vector2 v2, float enemiesSizeMultiplier, ObjectFilter<MapSystem.AabbEnemyEntry> cb)
      Parameters:
      cb - will be notified of all of the enemies inside AABB defined by v1 and v2. All of the references are not null. Return true to continue, false to stop
    • getEnemiesAABB

      public void getEnemiesAABB(float x1, float y1, float x2, float y2, float enemiesSizeMultiplier, ObjectFilter<MapSystem.AabbEnemyEntry> cb)
      Calls cb for every enemy inside the rectangle (any part of enemy counts, not just its center) Checks cells with 0.55 tiles padding around the AABB - enemies of larger size may not be recognized Note: enemy never null (if not modified during the loop)
    • getEnemiesNearPoint

      public void getEnemiesNearPoint(com.badlogic.gdx.utils.Array<Enemy> buffer, float x, float y, float radiusInPixels)
    • getEnemiesNearPoint

      public void getEnemiesNearPoint(com.badlogic.gdx.utils.Array<Enemy> buffer, float x, float y, float radiusInPixels, float minRadiusInPixels, ObjectFilter<Enemy> filter)
    • getEnemiesNearPoint

      public void getEnemiesNearPoint(float x, float y, float radiusInPixels, ObjectFilter<MapSystem.AabbEnemyEntry> cb)
      Note: enemy never null (if not modified during the loop)
    • getEnemiesNearPoint

      public void getEnemiesNearPoint(com.badlogic.gdx.math.Vector2 pos, float radiusInPixels, ObjectFilter<MapSystem.AabbEnemyEntry> cb)
    • getEnemiesTouchingCircle

      public void getEnemiesTouchingCircle(float x, float y, float radiusInPixels, ObjectFilter<MapSystem.AabbEnemyEntry> cb)
    • getEnemiesTouchingCircle

      public void getEnemiesTouchingCircle(com.badlogic.gdx.math.Vector2 pos, float radiusInPixels, ObjectFilter<MapSystem.AabbEnemyEntry> cb)
    • setup

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

      public void setSelectedTile(Tile selectedTile)
    • getSelectedTile

      public Tile getSelectedTile()
    • setSelectedGate

      public void setSelectedGate(Gate gate)
    • getSelectedGate

      public Gate getSelectedGate()
    • setHoveredTile

      public void setHoveredTile(Tile hoveredTile)
    • getHoveredTile

      public Tile getHoveredTile()
    • setHoveredGate

      public void setHoveredGate(Gate gate)
    • getHoveredGate

      public Gate getHoveredGate()
    • setGate

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

      public void setTile(int x, int y, Tile tile)
      Изменить тайл во время игры
    • 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)
    • rayCastEnemies

      public boolean rayCastEnemies(com.badlogic.gdx.utils.Array<Enemy.EnemyReference> buffer, float startX, float startY, float endX, float endY, float enemySizeMultiplier, boolean sortByDistance)
    • getSpawnedEnemiesCountByWave

      public int getSpawnedEnemiesCountByWave(int waveNumber)
    • 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
    • showAllPathTraces

      public void showAllPathTraces(boolean prepareAllPaths)
      TODO переместить в pathRenderingSystem
    • drawGateHover

      public void drawGateHover(com.badlogic.gdx.graphics.g2d.Batch batch, int x, int y, Gate.Side side)
    • drawGateSelection

      public void drawGateSelection(com.badlogic.gdx.graphics.g2d.Batch batch, int x, int y, Gate.Side side)
    • drawTileHover

      public void drawTileHover(com.badlogic.gdx.graphics.g2d.Batch batch, int x, int y)
    • drawTileSelection

      public void drawTileSelection(com.badlogic.gdx.graphics.g2d.Batch batch, int x, int y)
    • 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