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 classstatic enumstatic enumstatic classstatic interfacestatic interface -
Field Summary
FieldsModifier and TypeFieldDescriptionbooleancom.badlogic.gdx.utils.IntMap<BossType>static final intstatic final floatcom.badlogic.gdx.utils.DelayedRemovalArray<Wave>Fields inherited from class com.prineside.tdi2.Registrable
S -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanvoiddispose()Releases all resources of this object.voidДобавляет Action для вызова волны на следующем update()voidfreezeTimeToNextWave(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()intstatic floatgetDifficultWavesMultiplier(int waveNumber, int[] difficultyGrowWaves) Старый алгоритмint[]static com.badlogic.gdx.utils.Array<Enemy>getEnemiesToSpawn(float timeSinceStart, com.badlogic.gdx.utils.Array<EnemyGroup.SpawnEnemyGroup> enemyGroups) Создает объекты врагов по конфигурации группы.intintfloatfloatbooleanbooleanstatic voidvoidПроизвести окончательную настройку системы.voidread(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input) voidvoidsetAutoForceWaveEnabled(boolean enabled) voidsetBossWaves(com.badlogic.gdx.utils.IntMap<BossType> bossWaves) voidsetDifficultyGrowWaves(int low, int medium, int high) voidsetForcedTemplate(String templateName) voidsetStatus(WaveSystem.Status status) voidsetup()Произвести начальную настройку системы.voidsetWaveGenerator(WaveSystem.WaveGenerator generator) voidvoidstopSpawningCurrentWave(Tower killer, DamageType damageType) Остановить спавн врагов текущей волны.voidupdate(float deltaTime) voidwrite(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Output output) Methods inherited from class com.prineside.tdi2.GameSystem
getFastStateHash, postStateRestore, profileUpdateMethods 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:
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
-
setup
public void setup()Description copied from class:GameSystemПроизвести начальную настройку системы. На момент вызова этого метода, systemProvider содержит объекты всех систем.- Overrides:
setupin classGameSystem
-
getWaveStartInterval
public float getWaveStartInterval() -
setWaveGenerator
-
getWaveGenerator
-
postSetup
public void postSetup()Description copied from class:GameSystemПроизвести окончательную настройку системы. Во время вызова, все системы загружены и установлены (setup()), все слушатели добавлены- Overrides:
postSetupin 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:
updatein classGameSystem
-
getSystemName
- Specified by:
getSystemNamein classGameSystem
-
isAutoForceWaveEnabled
public boolean isAutoForceWaveEnabled() -
setAutoForceWaveEnabled
public void setAutoForceWaveEnabled(boolean enabled) -
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
-