Package com.prineside.tdi2.systems
Class MapSystem
java.lang.Object
com.prineside.tdi2.Registrable
com.prineside.tdi2.GameSystem
com.prineside.tdi2.systems.MapSystem
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
,com.esotericsoftware.kryo.KryoSerializable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static class
static class
static final class
static interface
-
Field Summary
FieldsModifier and TypeFieldDescriptionboolean
com.badlogic.gdx.utils.DelayedRemovalArray<Enemy.EnemyReference>
com.badlogic.gdx.utils.DelayedRemovalArray<Unit>
static final com.badlogic.gdx.graphics.Color
static final com.badlogic.gdx.graphics.Color
Fields inherited from class com.prineside.tdi2.Registrable
S
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
void
dispose()
Releases all resources of this object.void
drawBatch
(com.badlogic.gdx.graphics.g2d.Batch batch, float deltaTime) void
drawGateHover
(com.badlogic.gdx.graphics.g2d.Batch batch, int x, int y, Gate.Side side) void
drawGateSelection
(com.badlogic.gdx.graphics.g2d.Batch batch, int x, int y, Gate.Side side) void
drawTileHover
(com.badlogic.gdx.graphics.g2d.Batch batch, int x, int y) void
drawTileSelection
(com.badlogic.gdx.graphics.g2d.Batch batch, int x, int y) 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)void
getEnemiesAABB
(com.badlogic.gdx.math.Vector2 v1, com.badlogic.gdx.math.Vector2 v2, float enemiesSizeMultiplier, ObjectFilter<MapSystem.AabbEnemyEntry> cb) void
getEnemiesNearPoint
(float x, float y, float radiusInPixels, ObjectFilter<MapSystem.AabbEnemyEntry> cb) Note: enemy never null (if not modified during the loop)void
getEnemiesNearPoint
(com.badlogic.gdx.math.Vector2 pos, float radiusInPixels, ObjectFilter<MapSystem.AabbEnemyEntry> cb) void
getEnemiesNearPoint
(com.badlogic.gdx.utils.Array<Enemy> buffer, float x, float y, float radiusInPixels) void
getEnemiesNearPoint
(com.badlogic.gdx.utils.Array<Enemy> buffer, float x, float y, float radiusInPixels, float minRadiusInPixels, ObjectFilter<Enemy> filter) void
getEnemiesTouchingCircle
(float x, float y, float radiusInPixels, ObjectFilter<MapSystem.AabbEnemyEntry> cb) void
getEnemiesTouchingCircle
(com.badlogic.gdx.math.Vector2 pos, float radiusInPixels, ObjectFilter<MapSystem.AabbEnemyEntry> cb) getMap()
int
getSpawnedEnemiesCountByWave
(int waveNumber) void
getTileAndNeighbours
(int x, int y, com.badlogic.gdx.utils.Array<Tile> out) Получить тайл и соседей (по углам тоже)void
void
highlightGate
(Gate gate) void
highlightTile
(Tile tile) boolean
isPointWithinTile
(Tile tile, int x, int y) boolean
boolean
void
Произвести окончательную настройку системы.boolean
Нужно ли учитывать время выполнения update() в Debugboolean
rayCastEnemies
(com.badlogic.gdx.utils.Array<Enemy.EnemyReference> buffer, float startX, float startY, float endX, float endY, float enemySizeMultiplier, boolean sortByDistance) void
read
(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input) void
registerGate
(Gate gate) void
registerTile
(Tile tile) Напрямую внести тайл в регистр системы.void
removeBuilding
(Building building) void
void
removeMiner
(Miner miner) void
Изменить гейт во время игрыvoid
setHoveredGate
(Gate gate) void
setHoveredTile
(Tile hoveredTile) void
void
void
setModifier
(int x, int y, Modifier modifier) void
setPathTracesDrawing
(boolean drawing) Используется в Luavoid
setSelectedGate
(Gate gate) void
setSelectedTile
(Tile selectedTile) void
Изменить тайл во время игрыvoid
void
setup()
Произвести начальную настройку системы.void
showAllPathTraces
(boolean prepareAllPaths) TODO переместить в pathRenderingSystemvoid
showTileWarningParticle
(int x, int y) void
showTowerRangeHint
(float x, float y, float minRadius, float maxRadius) void
spawnEnemy
(Enemy enemy) Заспавнить врага на карте.void
void
unregisterGate
(Gate gate) void
unregisterTile
(Tile tile) Напрямую вывести тайл из регистра.void
update
(float deltaTime) boolean
upgradeCore
(int coreX, int coreY, int col, int row) boolean
upgradeCore
(CoreTile coreTile, int col, int row) Установить улучшение ядраvoid
upgradeCoreAction
(int coreX, int coreY, int col, int row) void
upgradeCoreAction
(CoreTile coreTile, int col, int row) void
write
(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Output output) Methods inherited from class com.prineside.tdi2.GameSystem
getFastStateHash, postStateRestore
Methods inherited from class com.prineside.tdi2.Registrable
isRegistered, setRegistered, setUnregistered
-
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
-
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 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
-
getMap
-
getTileAndNeighbours
Получить тайл и соседей (по углам тоже) -
setMap
-
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 classGameSystem
-
postSetup
public void postSetup()Description copied from class:GameSystem
Произвести окончательную настройку системы. Во время вызова, все системы загружены и установлены (setup()), все слушатели добавлены- Overrides:
postSetup
in classGameSystem
-
showTileWarningParticle
public void showTileWarningParticle(int x, int y) -
removeHighlights
public void removeHighlights() -
highlightTile
-
highlightGate
-
isPointWithinTile
-
isVisible
-
setSelectedTile
-
getSelectedTile
-
setSelectedGate
-
getSelectedGate
-
setHoveredTile
-
getHoveredTile
-
setHoveredGate
-
getHoveredGate
-
setGate
Изменить гейт во время игры -
setTile
Изменить тайл во время игры -
registerTile
Напрямую внести тайл в регистр системы. Вызывать при добавлении тайла на карту -
unregisterTile
Напрямую вывести тайл из регистра. Вызывать при удалении тайла из карты -
registerGate
-
unregisterGate
-
setTower
-
setModifier
-
removeBuilding
-
setMiner
-
removeMiner
-
isSpawned
-
spawnEnemy
Заспавнить врага на карте. Враг будет просто учитываться системой, но не получит сразу путь и позицию на карте - использовать эти данные можно только если enemy.setUpByEnemySystem -
spawnUnit
-
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
-
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
Установить улучшение ядра -
update
public void update(float deltaTime) - Overrides:
update
in classGameSystem
-
profileUpdate
public boolean profileUpdate()Description copied from class:GameSystem
Нужно ли учитывать время выполнения update() в Debug- Overrides:
profileUpdate
in classGameSystem
-
getSystemName
- Specified by:
getSystemName
in classGameSystem
-
setPathTracesDrawing
public void setPathTracesDrawing(boolean drawing) Используется в Lua -
showAllPathTraces
public void showAllPathTraces(boolean prepareAllPaths) TODO переместить в pathRenderingSystem -
drawGateHover
-
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 interfacecom.badlogic.gdx.utils.Disposable
- Overrides:
dispose
in classGameSystem
-