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:
com.badlogic.gdx.utils.Disposable
,com.esotericsoftware.kryo.KryoSerializable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static class
static interface
-
Field Summary
FieldsFields 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
void
buildMiner
(MinerType minerType, int x, int y) void
buildMinerAction
(MinerType minerType) На текущем выбранном тайлеvoid
buildMinerAction
(MinerType minerType, int x, int y) void
dispose()
Releases all resources of this object.void
drawBatch
(com.badlogic.gdx.graphics.g2d.Batch batch, float deltaTime) int
getBuildableMinersCount
(MinerType minerType) Возвращает количество майнеров, которые еще могут быть построеныint
getBuildPrice
(MinerType minerType) int
getGlobalUpgradePrice
(MinerType minerType) int
getMaxMinersCount
(MinerType minerType) Возвращает количество майнеров, которые вообще могут быть построеныint
getMaxUpgradeLevel
(MinerType minerType) float
getMiningSpeed
(Miner miner, ResourceType resourceType, int upgradeLevel) Скорость добычи ресурса с учетом уровня башни и плотности ресурсов, ресурсов в секундуint
getUpgradePrice
(Miner miner) void
boolean
isRegistered
(Tower tower) void
read
(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input) void
boolean
removeResources
(Miner miner, ResourceType resourceType, int amount) void
sellMiner
(int x, int y) void
sellMinerAction
(int x, int y) void
sellMinerAction
(Miner miner) void
setup()
Произвести начальную настройку системы.void
unregister
(Miner miner) void
update
(float deltaTime) void
upgradeMiner
(int x, int y) void
upgradeMiner
(Miner miner) void
upgradeMinerAction
(int x, int y) void
upgradeMinerAction
(Miner miner) void
write
(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Output output) Methods inherited from class com.prineside.tdi2.GameSystem
getFastStateHash, postSetup, postStateRestore, profileUpdate
Methods inherited from class com.prineside.tdi2.Registrable
isRegistered, setRegistered, setUnregistered
-
Field Details
-
miners
-
listeners
-
-
Constructor Details
-
MinerSystem
public MinerSystem()
-
-
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
-
isRegistered
-
register
-
unregister
-
addResources
-
removeResources
-
getMaxUpgradeLevel
-
getGlobalUpgradePrice
-
getMaxMinersCount
Возвращает количество майнеров, которые вообще могут быть построены -
getBuildableMinersCount
Возвращает количество майнеров, которые еще могут быть построены -
getBuildPrice
-
getUpgradePrice
-
upgradeMinerAction
-
upgradeMinerAction
public void upgradeMinerAction(int x, int y) -
globalUpgradeMinerAction
-
upgradeMiner
-
upgradeMiner
public void upgradeMiner(int x, int y) -
buildMinerAction
На текущем выбранном тайле -
buildMinerAction
-
buildMiner
-
sellMinerAction
-
sellMinerAction
public void sellMinerAction(int x, int y) -
sellMiner
public void sellMiner(int x, int y) -
getMiningSpeed
Скорость добычи ресурса с учетом уровня башни и плотности ресурсов, ресурсов в секунду -
update
public void update(float deltaTime) - Overrides:
update
in classGameSystem
-
getSystemName
- Specified by:
getSystemName
in classGameSystem
-
drawBatch
public void drawBatch(com.badlogic.gdx.graphics.g2d.Batch batch, float deltaTime) -
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
-