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 classstatic classstatic classstatic final classstatic interface -
Field Summary
FieldsModifier and TypeFieldDescriptionbooleancom.badlogic.gdx.utils.DelayedRemovalArray<Enemy.EnemyReference>com.badlogic.gdx.utils.DelayedRemovalArray<Unit>static final com.badlogic.gdx.graphics.Colorstatic final com.badlogic.gdx.graphics.ColorFields inherited from class com.prineside.tdi2.Registrable
S -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoiddispose()Releases all resources of this object.voiddrawBatch(com.badlogic.gdx.graphics.g2d.Batch batch, float deltaTime) voiddrawGateHover(com.badlogic.gdx.graphics.g2d.Batch batch, int x, int y, Gate.Side side) voiddrawGateSelection(com.badlogic.gdx.graphics.g2d.Batch batch, int x, int y, Gate.Side side) voiddrawTileHover(com.badlogic.gdx.graphics.g2d.Batch batch, int x, int y) voiddrawTileSelection(com.badlogic.gdx.graphics.g2d.Batch batch, int x, int y) voidgetEnemiesAABB(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)voidgetEnemiesAABB(com.badlogic.gdx.math.Vector2 v1, com.badlogic.gdx.math.Vector2 v2, float enemiesSizeMultiplier, ObjectFilter<MapSystem.AabbEnemyEntry> cb) voidgetEnemiesNearPoint(float x, float y, float radiusInPixels, ObjectFilter<MapSystem.AabbEnemyEntry> cb) Note: enemy never null (if not modified during the loop)voidgetEnemiesNearPoint(com.badlogic.gdx.math.Vector2 pos, float radiusInPixels, ObjectFilter<MapSystem.AabbEnemyEntry> cb) voidgetEnemiesNearPoint(com.badlogic.gdx.utils.Array<Enemy> buffer, float x, float y, float radiusInPixels) voidgetEnemiesNearPoint(com.badlogic.gdx.utils.Array<Enemy> buffer, float x, float y, float radiusInPixels, float minRadiusInPixels, ObjectFilter<Enemy> filter) voidgetEnemiesTouchingCircle(float x, float y, float radiusInPixels, ObjectFilter<MapSystem.AabbEnemyEntry> cb) voidgetEnemiesTouchingCircle(com.badlogic.gdx.math.Vector2 pos, float radiusInPixels, ObjectFilter<MapSystem.AabbEnemyEntry> cb) getMap()intgetSpawnedEnemiesCountByWave(int waveNumber) voidgetTileAndNeighbours(int x, int y, com.badlogic.gdx.utils.Array<Tile> out) Получить тайл и соседей (по углам тоже)voidvoidhighlightGate(Gate gate) voidhighlightTile(Tile tile) booleanisPointWithinTile(Tile tile, int x, int y) booleanbooleanvoidПроизвести окончательную настройку системы.booleanНужно ли учитывать время выполнения update() в DebugbooleanrayCastEnemies(com.badlogic.gdx.utils.Array<Enemy.EnemyReference> buffer, float startX, float startY, float endX, float endY, float enemySizeMultiplier, boolean sortByDistance) voidread(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input) voidregisterGate(Gate gate) voidregisterTile(Tile tile) Напрямую внести тайл в регистр системы.voidremoveBuilding(Building building) voidvoidremoveMiner(Miner miner) voidИзменить гейт во время игрыvoidsetHoveredGate(Gate gate) voidsetHoveredTile(Tile hoveredTile) voidvoidvoidsetModifier(int x, int y, Modifier modifier) voidsetPathTracesDrawing(boolean drawing) Используется в LuavoidsetSelectedGate(Gate gate) voidsetSelectedTile(Tile selectedTile) voidИзменить тайл во время игрыvoidvoidsetup()Произвести начальную настройку системы.voidshowAllPathTraces(boolean prepareAllPaths) TODO переместить в pathRenderingSystemvoidshowTileWarningParticle(int x, int y) voidshowTowerRangeHint(float x, float y, float minRadius, float maxRadius) voidspawnEnemy(Enemy enemy) Заспавнить врага на карте.voidvoidunregisterGate(Gate gate) voidunregisterTile(Tile tile) Напрямую вывести тайл из регистра.voidupdate(float deltaTime) booleanupgradeCore(int coreX, int coreY, int col, int row) booleanupgradeCore(CoreTile coreTile, int col, int row) Установить улучшение ядраvoidupgradeCoreAction(int coreX, int coreY, int col, int row) voidupgradeCoreAction(CoreTile coreTile, int col, int row) voidwrite(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Output output) Methods inherited from class com.prineside.tdi2.GameSystem
getFastStateHash, postStateRestoreMethods 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:
writein interfacecom.esotericsoftware.kryo.KryoSerializable- Overrides:
writein classRegistrable
-
read
public void read(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input) - Specified by:
readin interfacecom.esotericsoftware.kryo.KryoSerializable- Overrides:
readin classRegistrable
-
affectsGameState
public boolean affectsGameState()- Specified by:
affectsGameStatein 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:
setupin classGameSystem
-
postSetup
public void postSetup()Description copied from class:GameSystemПроизвести окончательную настройку системы. Во время вызова, все системы загружены и установлены (setup()), все слушатели добавлены- Overrides:
postSetupin 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:
updatein classGameSystem
-
profileUpdate
public boolean profileUpdate()Description copied from class:GameSystemНужно ли учитывать время выполнения update() в Debug- Overrides:
profileUpdatein classGameSystem
-
getSystemName
- Specified by:
getSystemNamein 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.DisposableReleases all resources of this object.- Specified by:
disposein interfacecom.badlogic.gdx.utils.Disposable- Overrides:
disposein classGameSystem
-