Package com.prineside.tdi2.systems
Class WaveSystem
java.lang.Object
com.prineside.tdi2.Registrable
com.prineside.tdi2.GameSystem
com.prineside.tdi2.systems.WaveSystem
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
,com.esotericsoftware.kryo.KryoSerializable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static enum
static enum
static class
static interface
static interface
-
Field Summary
FieldsModifier and TypeFieldDescriptionboolean
com.badlogic.gdx.utils.IntMap<BossType>
static final int
static final float
com.badlogic.gdx.utils.DelayedRemovalArray<Wave>
Fields inherited from class com.prineside.tdi2.Registrable
S
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
void
dispose()
Releases all resources of this object.void
Добавляет Action для вызова волны на следующем update()void
freezeTimeToNextWave
(float duration) Время до следующей волны не будет считаться.static com.badlogic.gdx.utils.Array<EnemyGroup>
generateEnemyGroups
(int waveNumber, WaveSystem.Mode mode, int[] difficultyGrowWaves, int averageDifficulty, com.badlogic.gdx.utils.IntMap<BossType> bossWaves, Map map, long seed, WaveTemplates.PredefinedWaveTemplate[] predefinedWaveTemplates) Должен работать так же, как generateWave()int
static float
getDifficultWavesMultiplier
(int waveNumber, int[] difficultyGrowWaves) Старый алгоритмint[]
static com.badlogic.gdx.utils.Array<Enemy>
getEnemiesToSpawn
(float timeSinceStart, com.badlogic.gdx.utils.Array<EnemyGroup.SpawnEnemyGroup> enemyGroups) Создает объекты врагов по конфигурации группы.int
int
float
float
boolean
boolean
static void
void
Произвести окончательную настройку системы.void
read
(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input) void
void
setAutoForceWaveEnabled
(boolean enabled) void
setBossWaves
(com.badlogic.gdx.utils.IntMap<BossType> bossWaves) void
setDifficultyGrowWaves
(int low, int medium, int high) void
setForcedTemplate
(String templateName) void
setStatus
(WaveSystem.Status status) void
setup()
Произвести начальную настройку системы.void
setWaveGenerator
(WaveSystem.WaveGenerator generator) void
void
stopSpawningCurrentWave
(Tower killer, DamageType damageType) Остановить спавн врагов текущей волны.void
update
(float deltaTime) void
write
(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Output output) Methods inherited from class com.prineside.tdi2.GameSystem
getFastStateHash, postStateRestore, profileUpdate
Methods inherited from class com.prineside.tdi2.Registrable
isRegistered, setRegistered, setUnregistered
-
Field Details
-
NEXT_WAVES_CACHE_SIZE
public static final int NEXT_WAVES_CACHE_SIZE- See Also:
-
ULTRA_DIFFICULT_MILESTONE_MULTIPLIER
public static final float ULTRA_DIFFICULT_MILESTONE_MULTIPLIER- See Also:
-
mode
-
status
-
wave
-
autoForceWaveEnabled
public boolean autoForceWaveEnabled -
nextWavesCache
-
wavesToNotifyAboutCompletion
-
predefinedWaveTemplates
-
bossWaves
-
listeners
-
-
Constructor Details
-
WaveSystem
public WaveSystem()
-
-
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
-
setup
public void setup()Description copied from class:GameSystem
Произвести начальную настройку системы. На момент вызова этого метода, systemProvider содержит объекты всех систем.- Overrides:
setup
in classGameSystem
-
getWaveStartInterval
public float getWaveStartInterval() -
setWaveGenerator
-
getWaveGenerator
-
postSetup
public void postSetup()Description copied from class:GameSystem
Произвести окончательную настройку системы. Во время вызова, все системы загружены и установлены (setup()), все слушатели добавлены- Overrides:
postSetup
in classGameSystem
-
setForcedTemplate
-
setBossWaves
-
resetNextWavesCache
public void resetNextWavesCache() -
getForceWaveBonus
public int getForceWaveBonus() -
getCompletedWavesCount
public int getCompletedWavesCount()- Returns:
- номер последней волны, в которой не осталось заспавненных врагов
-
isForceWaveAvailable
public boolean isForceWaveAvailable() -
forceNextWaveAction
public void forceNextWaveAction()Добавляет Action для вызова волны на следующем update() -
freezeTimeToNextWave
public void freezeTimeToNextWave(float duration) Время до следующей волны не будет считаться. Если меньше 0, заморозка отключается -
setStatus
-
setDifficultyGrowWaves
public void setDifficultyGrowWaves(int low, int medium, int high) -
getDifficultyGrowWaves
public int[] getDifficultyGrowWaves() -
getImpossibleWaveNumber
public int getImpossibleWaveNumber() -
getDifficultWavesMultiplier
public static float getDifficultWavesMultiplier(int waveNumber, int[] difficultyGrowWaves) Старый алгоритм -
main
-
generateEnemyGroups
public static com.badlogic.gdx.utils.Array<EnemyGroup> generateEnemyGroups(int waveNumber, WaveSystem.Mode mode, int[] difficultyGrowWaves, int averageDifficulty, com.badlogic.gdx.utils.IntMap<BossType> bossWaves, Map map, long seed, WaveTemplates.PredefinedWaveTemplate[] predefinedWaveTemplates) Должен работать так же, как generateWave() -
allWavesSpawned
public boolean allWavesSpawned() -
startNextWave
public void startNextWave() -
getTimeToNextWave
public float getTimeToNextWave() -
getEnemiesToSpawn
public static com.badlogic.gdx.utils.Array<Enemy> getEnemiesToSpawn(float timeSinceStart, com.badlogic.gdx.utils.Array<EnemyGroup.SpawnEnemyGroup> enemyGroups) Создает объекты врагов по конфигурации группы. Изменяет EnemyGroup.spawnedCount -
stopSpawningCurrentWave
Остановить спавн врагов текущей волны. Будет считаться, что врагов вообще никогда не было. -
update
public void update(float deltaTime) - Overrides:
update
in classGameSystem
-
getSystemName
- Specified by:
getSystemName
in classGameSystem
-
isAutoForceWaveEnabled
public boolean isAutoForceWaveEnabled() -
setAutoForceWaveEnabled
public void setAutoForceWaveEnabled(boolean enabled) -
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
-