Package com.prineside.tdi2
Class Modifier
java.lang.Object
com.prineside.tdi2.Registrable
com.prineside.tdi2.Building
com.prineside.tdi2.Modifier
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
,com.esotericsoftware.kryo.KryoSerializable
,ScheduledUpdater.Updatable
- Direct Known Subclasses:
AttackSpeedModifier
,BalanceModifier
,BountyModifier
,DamageModifier
,ExperienceModifier
,MiningSpeedModifier
,PowerModifier
,SearchModifier
public abstract class Modifier
extends Building
implements com.badlogic.gdx.utils.Disposable, ScheduledUpdater.Updatable
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionboolean[]
int
int
static final float
float
static final float[][]
Fields inherited from class com.prineside.tdi2.Building
buildingType
Fields inherited from class com.prineside.tdi2.Registrable
S
-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
void
customButtonAction
(int mapX, int mapY) void
dispose()
Releases all resources of this object.void
drawBatch
(com.badlogic.gdx.graphics.g2d.Batch batch, float deltaTime, MapRenderingSystem.DrawMode drawMode) void
drawBatchAdditive
(com.badlogic.gdx.graphics.g2d.Batch batch, float deltaTime, MapRenderingSystem.DrawMode drawMode) void
fillModifierMenu
(com.badlogic.gdx.scenes.scene2d.Group container, com.badlogic.gdx.utils.ObjectMap<String, Object> elements) Добавить / обновить элементы в меню Вызывается каждый кадр, когда видно меню elements сохраняется между вызовами метода, чтобы не создавать актеров заново.float
For how long it will not be possible to sell the modifierint
float
float
boolean
boolean
boolean
void
loadFromJson
(com.badlogic.gdx.utils.JsonValue value) void
read
(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input) boolean
final int
final void
scheduledUpdatableSetId
(int id) void
scheduledUpdate
(float deltaTime) void
setSideConnected
(Modifier.ConnectionSide side, boolean connected) void
toJson
(com.badlogic.gdx.utils.Json json) void
update
(float deltaTime) void
void
updateCustomButton
(ComplexButton complexButton, boolean isPointing) void
write
(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Output output) Methods inherited from class com.prineside.tdi2.Building
drawBase, drawHoveredRange, drawSelectedRange, fromJson, getTile, placedOnMap, removedFromMap, setTile
Methods inherited from class com.prineside.tdi2.Registrable
isRegistered, setRegistered, setUnregistered
-
Field Details
-
PENALTY_SELL_PRICE
public static final float PENALTY_SELL_PRICE- See Also:
-
WIRES_TEXTURES_CONFIG
public static final float[][] WIRES_TEXTURES_CONFIG -
id
public int id -
type
-
timeSinceBuilt
public float timeSinceBuilt -
connectedSides
public boolean[] connectedSides -
moneySpentOn
public int moneySpentOn
-
-
Method Details
-
write
public void write(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Output output) -
read
public void read(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input) -
getWalkCost
public float getWalkCost()- Specified by:
getWalkCost
in classBuilding
-
setSideConnected
-
connectsToTowers
public boolean connectsToTowers() -
connectsToMiners
public boolean connectsToMiners() -
getSellDelay
public float getSellDelay()For how long it will not be possible to sell the modifier -
getTimeTillSellAvailable
public float getTimeTillSellAvailable() -
isSellAvailable
public boolean isSellAvailable() -
getSellPrice
public int getSellPrice() -
updateCache
public void updateCache()- Specified by:
updateCache
in classBuilding
-
fillModifierMenu
public void fillModifierMenu(com.badlogic.gdx.scenes.scene2d.Group container, com.badlogic.gdx.utils.ObjectMap<String, Object> elements) Добавить / обновить элементы в меню Вызывается каждый кадр, когда видно меню elements сохраняется между вызовами метода, чтобы не создавать актеров заново. Если он пустой - значит, вызвали первый раз и надо создать Можно не обновлять ничего, если состояние устраивает (можно хранить любые данные в elements, например хэш состояния или предыдущие значения) -
hasCustomButton
public boolean hasCustomButton() -
isCustomButtonNeedMapPoint
public boolean isCustomButtonNeedMapPoint() -
customButtonAction
public void customButtonAction(int mapX, int mapY) -
updateCustomButton
-
toJson
public void toJson(com.badlogic.gdx.utils.Json json) -
drawBatch
public void drawBatch(com.badlogic.gdx.graphics.g2d.Batch batch, float deltaTime, MapRenderingSystem.DrawMode drawMode) -
drawBatchAdditive
public void drawBatchAdditive(com.badlogic.gdx.graphics.g2d.Batch batch, float deltaTime, MapRenderingSystem.DrawMode drawMode) -
sameAs
-
cloneBuilding
- Specified by:
cloneBuilding
in classBuilding
-
update
public void update(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
-
scheduledUpdate
public void scheduledUpdate(float deltaTime) - Specified by:
scheduledUpdate
in interfaceScheduledUpdater.Updatable
-
scheduledUpdatableSetId
public final void scheduledUpdatableSetId(int id) - Specified by:
scheduledUpdatableSetId
in interfaceScheduledUpdater.Updatable
-
scheduledUpdatableGetId
public final int scheduledUpdatableGetId()- Specified by:
scheduledUpdatableGetId
in interfaceScheduledUpdater.Updatable
-
loadFromJson
public void loadFromJson(com.badlogic.gdx.utils.JsonValue value)
-