Package com.prineside.tdi2.systems
Class GameValueSystem
java.lang.Object
com.prineside.tdi2.Registrable
com.prineside.tdi2.GameSystem
com.prineside.tdi2.systems.GameValueSystem
- All Implemented Interfaces:
Disposable
,KryoSerializable
,GameValueProvider
public final class GameValueSystem
extends GameSystem
implements GameValueProvider, KryoSerializable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
static class
-
Field Summary
Fields inherited from class com.prineside.tdi2.Registrable
S
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCustomGameValue
(GameValueConfig config) boolean
addGlobalTowerStatMutator
(TowerStatType towerStatType, GameValueSystem.GlobalTowerStatMutator mutator) boolean
boolean
float
float
getFloatValueSum
(GameValueType gv1, GameValueType gv2) If not set yet, generates snapshot on demand, based on the current difficulty mode, level, gameStartProgressSnapshot and TargetTile config.float
getGlobalTowerStatMutators
(TowerStatType towerStatType) int
int
getIntValueSum
(GameValueType gv1, GameValueType gv2) double
double
double
int
float
double
void
void
Вызывать всегда, когда поменялась конфигурация во время игры (сменился эффект тайла и т.п.)void
void
removeCustomGameValue
(GameValueConfig config) boolean
removeGlobalTowerStatMutator
(TowerStatType towerStatType, GameValueSystem.GlobalTowerStatMutator mutator) void
Set snapshot manually.void
setup()
Performs the initial configuration of the system.void
Methods inherited from class com.prineside.tdi2.GameSystem
dispose, getFastStateHash, postSetup, postStateRestore, profileUpdate, update
Methods inherited from class com.prineside.tdi2.Registrable
isRegistered, setRegistered, setUnregistered
-
Constructor Details
-
GameValueSystem
public GameValueSystem()
-
-
Method Details
-
write
- Specified by:
write
in interfaceKryoSerializable
- Overrides:
write
in classRegistrable
-
read
- Specified by:
read
in interfaceKryoSerializable
- Overrides:
read
in classRegistrable
-
affectsGameState
public boolean affectsGameState()- Specified by:
affectsGameState
in classGameSystem
-
getGlobalStatMultiplier
-
addGlobalTowerStatMutator
public boolean addGlobalTowerStatMutator(TowerStatType towerStatType, GameValueSystem.GlobalTowerStatMutator mutator) -
removeGlobalTowerStatMutator
public boolean removeGlobalTowerStatMutator(TowerStatType towerStatType, GameValueSystem.GlobalTowerStatMutator mutator) -
getGlobalTowerStatMutators
public Array<GameValueSystem.GlobalTowerStatMutator> getGlobalTowerStatMutators(TowerStatType towerStatType) -
recalculateGlobalTowerStatMultipliers
public void recalculateGlobalTowerStatMultipliers() -
setup
public void setup()Description copied from class:GameSystem
Performs the initial configuration of the system. At the moment of call, systemProvider already contains all objects of systems.- Overrides:
setup
in classGameSystem
-
getSystemName
- Specified by:
getSystemName
in classGameSystem
-
getGlobalSnapshot
If not set yet, generates snapshot on demand, based on the current difficulty mode, level, gameStartProgressSnapshot and TargetTile config. -
setGlobalSnapshot
Set snapshot manually. Don't forget to call `recalculate()` after.- Parameters:
snapshot
- the snapshot. If null, next time `getGlobalSnapshot()` is called, a new default global snapshot will be auto-generated
-
getSnapshot
-
getTickRate
public int getTickRate() -
getTickRateDeltaTime
public float getTickRateDeltaTime() -
recalculate
public void recalculate()Вызывать всегда, когда поменялась конфигурация во время игры (сменился эффект тайла и т.п.) -
addCustomGameValue
-
removeCustomGameValue
-
getValue
- Specified by:
getValue
in interfaceGameValueProvider
-
getFloatValue
- Specified by:
getFloatValue
in interfaceGameValueProvider
-
getBooleanValue
- Specified by:
getBooleanValue
in interfaceGameValueProvider
-
getIntValue
- Specified by:
getIntValue
in interfaceGameValueProvider
-
getIntValueSum
- Specified by:
getIntValueSum
in interfaceGameValueProvider
-
getFloatValueSum
- Specified by:
getFloatValueSum
in interfaceGameValueProvider
-
getPercentValueAsMultiplier
- Specified by:
getPercentValueAsMultiplier
in interfaceGameValueProvider
-
getPercentValueAsMultiplierSum
- Specified by:
getPercentValueAsMultiplierSum
in interfaceGameValueProvider
-
getPercentValueAsMultiplierSumAll
- Specified by:
getPercentValueAsMultiplierSumAll
in interfaceGameValueProvider
-