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 ClassesModifier and TypeClassDescriptionstatic enumstatic classModifier.Factory<T extends Modifier>static class -
Field Summary
FieldsModifier and TypeFieldDescriptionboolean[]intstatic final floatfloatstatic final float[][]Fields inherited from class com.prineside.tdi2.Building
buildingTypeFields inherited from class com.prineside.tdi2.Registrable
S -
Method Summary
Modifier and TypeMethodDescriptionvoidcustomButtonAction(int mapX, int mapY) voiddispose()Releases all resources of this object.voiddrawBatch(com.badlogic.gdx.graphics.g2d.Batch batch, float deltaTime, MapRenderingSystem.DrawMode drawMode) voiddrawBatchAdditive(com.badlogic.gdx.graphics.g2d.Batch batch, float deltaTime, MapRenderingSystem.DrawMode drawMode) voidfillModifierMenu(com.badlogic.gdx.scenes.scene2d.Group container, com.badlogic.gdx.utils.ObjectMap<String, Object> elements) Добавить / обновить элементы в меню Вызывается каждый кадр, когда видно меню elements сохраняется между вызовами метода, чтобы не создавать актеров заново.floatFor how long it will not be possible to sell the modifierintfloatbooleanbooleanbooleanvoidloadFromJson(com.badlogic.gdx.utils.JsonValue value) voidПо умолчанию добавляет все 8 ближайших башенvoidread(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input) voidfinal intfinal voidscheduledUpdatableSetId(int id) voidscheduledUpdate(float deltaTime) voidsetSideConnected(Modifier.ConnectionSide side, boolean connected) voidtoJson(com.badlogic.gdx.utils.Json json) voidupdate(float deltaTime) voidupdateCustomButton(ComplexButton complexButton, boolean isPointing) voidwrite(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, setTileMethods 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
-
-
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) -
setSideConnected
-
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() -
nearbyBuildingsChanged
public void nearbyBuildingsChanged()По умолчанию добавляет все 8 ближайших башен -
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) -
cloneBuilding
- Specified by:
cloneBuildingin classBuilding
-
update
public void update(float deltaTime) -
dispose
public void dispose()Description copied from interface:com.badlogic.gdx.utils.DisposableReleases all resources of this object.- Specified by:
disposein interfacecom.badlogic.gdx.utils.Disposable
-
scheduledUpdate
public void scheduledUpdate(float deltaTime) - Specified by:
scheduledUpdatein interfaceScheduledUpdater.Updatable
-
scheduledUpdatableSetId
public final void scheduledUpdatableSetId(int id) - Specified by:
scheduledUpdatableSetIdin interfaceScheduledUpdater.Updatable
-
scheduledUpdatableGetId
public final int scheduledUpdatableGetId()- Specified by:
scheduledUpdatableGetIdin interfaceScheduledUpdater.Updatable
-
removedFromMap
public void removedFromMap()- Overrides:
removedFromMapin classBuilding
-
loadFromJson
public void loadFromJson(com.badlogic.gdx.utils.JsonValue value)
-