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 class
static final class
-
Field Summary
FieldsModifier and TypeFieldDescriptionfloat
Fields inherited from class com.prineside.tdi2.Registrable
S
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addResources
(Miner miner, ResourceType resourceType, int amount, boolean mined) boolean
buildMiner
(MinerType minerType, int x, int y, boolean checkMinerCountLimit, boolean costsCoins) void
buildMinerActionAt
(MinerType minerType, int x, int y) void
buildMinerActionForSelectedTile
(MinerType minerType) На текущем выбранном тайлеfloat
calculateScorePerMinute
(Miner miner) void
dispose()
Releases all resources of this object.static void
drawBatch
(Batch batch, Map map, float deltaTime, MapRenderingSystem.DrawMode drawMode) float
getBaseMiningSpeed
(Miner miner, int upgradeLevel) Resources/s, not affected by modifiers or double speedfloat
int
getBuildableMinersCount
(MinerType minerType) int
getBuildPrice
(MinerType minerType) int
getGlobalUpgradePrice
(MinerType minerType) int
getMaxMinersCount
(MinerType minerType) Возвращает количество майнеров, которые вообще могут быть построеныint
getMaxUpgradeLevel
(MinerType minerType) float
getMiningSpeed
(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 minerint
getMiningSpeedModifierCount
(Miner miner) float
float
int
getResourceMinedRawScore
(ResourceType resourceType) int
getUpgradePrice
(Miner miner) void
boolean
isRegistered
(Tower tower) void
void
void
boolean
removeResources
(Miner miner, ResourceType resourceType, int amount) boolean
sellMiner
(int x, int y) void
sellMinerAction
(Miner miner) void
sellMinerActionAt
(int x, int y) void
setup()
Performs the initial configuration of the system.void
unregister
(Miner miner) void
update
(float deltaTime) boolean
upgradeMiner
(Miner miner) void
upgradeMinerAction
(Miner miner) void
upgradeMinerActionAt
(int x, int y) boolean
upgradeMinerAt
(int x, int y) void
Methods inherited from class com.prineside.tdi2.GameSystem
getFastStateHash, postSetup, profileUpdate
Methods 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:
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
-
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
-
postStateRestore
public void postStateRestore()- Overrides:
postStateRestore
in 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:
update
in classGameSystem
-
getSystemName
- Specified by:
getSystemName
in 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.Disposable
Releases all resources of this object.- Specified by:
dispose
in interfaceDisposable
- Overrides:
dispose
in classGameSystem
-