Class 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
  • 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

      public ModifierType type
    • timeSinceBuilt

      public float timeSinceBuilt
    • connectedSides

      public boolean[] connectedSides
    • moneySpentOn

      public CheatSafeInt moneySpentOn
  • Method Details

    • write

      public void write(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Output output)
      Specified by:
      write in interface com.esotericsoftware.kryo.KryoSerializable
      Overrides:
      write in class Building
    • read

      public void read(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input)
      Specified by:
      read in interface com.esotericsoftware.kryo.KryoSerializable
      Overrides:
      read in class Building
    • setSideConnected

      public void setSideConnected(Modifier.ConnectionSide side, boolean connected)
    • 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

      public void updateCustomButton(ComplexButton complexButton, boolean isPointing)
    • toJson

      public void toJson(com.badlogic.gdx.utils.Json json)
      Overrides:
      toJson in class Building
    • 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

      public Modifier cloneBuilding()
      Specified by:
      cloneBuilding in class Building
    • 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 interface com.badlogic.gdx.utils.Disposable
    • scheduledUpdate

      public void scheduledUpdate(float deltaTime)
      Specified by:
      scheduledUpdate in interface ScheduledUpdater.Updatable
    • scheduledUpdatableSetId

      public final void scheduledUpdatableSetId(int id)
      Specified by:
      scheduledUpdatableSetId in interface ScheduledUpdater.Updatable
    • scheduledUpdatableGetId

      public final int scheduledUpdatableGetId()
      Specified by:
      scheduledUpdatableGetId in interface ScheduledUpdater.Updatable
    • removedFromMap

      public void removedFromMap()
      Overrides:
      removedFromMap in class Building
    • loadFromJson

      public void loadFromJson(com.badlogic.gdx.utils.JsonValue value)