Package com.prineside.tdi2.systems
Class MinerSystem
java.lang.Object
com.prineside.tdi2.Registrable
com.prineside.tdi2.GameSystem
com.prineside.tdi2.systems.MinerSystem
- All Implemented Interfaces:
Disposable,KryoSerializable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic final class -
Field Summary
FieldsModifier and TypeFieldDescriptionfloatFields inherited from class com.prineside.tdi2.Registrable
S -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddResources(Miner miner, ResourceType resourceType, int amount, boolean mined) booleanbuildMiner(MinerType minerType, int x, int y, boolean checkMinerCountLimit, boolean costsCoins) voidbuildMinerActionAt(MinerType minerType, int x, int y) voidbuildMinerActionForSelectedTile(MinerType minerType) На текущем выбранном тайлеfloatcalculateScorePerMinute(Miner miner) voiddispose()Releases all resources of this object.static voiddrawBatch(Batch batch, Map map, float deltaTime, MapRenderingSystem.DrawMode drawMode) floatgetBaseMiningSpeed(Miner miner, int upgradeLevel) Resources/s, not affected by modifiers or double speedfloatintgetBuildableMinersCount(MinerType minerType) intgetBuildPrice(MinerType minerType) intgetGlobalUpgradePrice(MinerType minerType) intgetMaxMinersCount(MinerType minerType) Возвращает количество майнеров, которые вообще могут быть построеныintgetMaxUpgradeLevel(MinerType minerType) floatgetMiningSpeed(Miner miner, int upgradeLevel) Resources/s, accounts for modifiers and bonus 2x speed Does not account for the accumulated 2x mining speed time of this minerintgetMiningSpeedModifierCount(Miner miner) floatfloatintgetResourceMinedRawScore(ResourceType resourceType) intgetUpgradePrice(Miner miner) voidbooleanisRegistered(Tower tower) voidvoidvoidbooleanremoveResources(Miner miner, ResourceType resourceType, int amount) booleansellMiner(int x, int y) voidsellMinerAction(Miner miner) voidsellMinerActionAt(int x, int y) voidsetup()Performs the initial configuration of the system.voidunregister(Miner miner) voidupdate(float deltaTime) booleanupgradeMiner(Miner miner) voidupgradeMinerAction(Miner miner) voidupgradeMinerActionAt(int x, int y) booleanupgradeMinerAt(int x, int y) voidMethods inherited from class com.prineside.tdi2.GameSystem
getFastStateHash, postSetup, profileUpdateMethods inherited from class com.prineside.tdi2.Registrable
isRegistered, setRegistered, setUnregistered
-
Field Details
-
miners
-
bonusDoubleMiningSpeedTimeLeft
public float bonusDoubleMiningSpeedTimeLeft
-
-
Constructor Details
-
MinerSystem
public MinerSystem()
-
-
Method Details
-
write
- Specified by:
writein interfaceKryoSerializable- Overrides:
writein classRegistrable
-
read
- Specified by:
readin interfaceKryoSerializable- Overrides:
readin classRegistrable
-
affectsGameState
public boolean affectsGameState()- Specified by:
affectsGameStatein classGameSystem
-
setup
public void setup()Description copied from class:GameSystemPerforms the initial configuration of the system. At the moment of call, systemProvider already contains all objects of systems.- Overrides:
setupin classGameSystem
-
postStateRestore
public void postStateRestore()- Overrides:
postStateRestorein classGameSystem
-
getBonusDoubleMiningSpeedTimeLeft
public float getBonusDoubleMiningSpeedTimeLeft() -
isRegistered
-
register
-
unregister
-
addResources
-
removeResources
-
getMaxUpgradeLevel
-
getGlobalUpgradePrice
-
getMaxMinersCount
Возвращает количество майнеров, которые вообще могут быть построены -
getBuildableMinersCount
- Returns:
- number of miners of the specified type that still can be built. Will return 0 even if number of miners on map exceeds max miner count in the build menu
-
getBuildPrice
-
getUpgradePrice
-
upgradeMinerAction
-
upgradeMinerActionAt
public void upgradeMinerActionAt(int x, int y) -
globalUpgradeMinerAction
-
upgradeMiner
-
upgradeMinerAt
public boolean upgradeMinerAt(int x, int y) -
buildMinerActionForSelectedTile
На текущем выбранном тайле -
buildMinerActionAt
-
buildMiner
-
sellMinerAction
-
sellMinerActionAt
public void sellMinerActionAt(int x, int y) -
sellMiner
public boolean sellMiner(int x, int y) -
getResourceMinedRawScore
-
calculateScorePerMinute
-
getBaseMiningSpeed
Resources/s, not affected by modifiers or double speed -
getMiningSpeedModifierCount
-
getMiningSpeedModifierEfficiencyPerCount
public float getMiningSpeedModifierEfficiencyPerCount(int cnt) -
getMiningSpeedModifierMultiplier
-
getMiningSpeed
Resources/s, accounts for modifiers and bonus 2x speed Does not account for the accumulated 2x mining speed time of this miner -
update
public void update(float deltaTime) - Overrides:
updatein classGameSystem
-
getSystemName
- Specified by:
getSystemNamein classGameSystem
-
drawBatch
public static void drawBatch(Batch batch, Map map, float deltaTime, MapRenderingSystem.DrawMode drawMode) -
dispose
public void dispose()Description copied from interface:com.badlogic.gdx.utils.DisposableReleases all resources of this object.- Specified by:
disposein interfaceDisposable- Overrides:
disposein classGameSystem
-