Class ProgressManager

java.lang.Object
com.prineside.tdi2.Manager.ManagerAdapter
com.prineside.tdi2.managers.ProgressManager
All Implemented Interfaces:
Disposable, Manager

public class ProgressManager extends Manager.ManagerAdapter
Отвечает за основной прогресс игры (достижения, деньги, ресурсы)
  • Field Details

  • Constructor Details

    • ProgressManager

      public ProgressManager()
  • Method Details

    • removeIssuedItemsLog

      public void removeIssuedItemsLog()
    • getIssuedItems

      public Array<IssuedItems> getIssuedItems()
    • handleGameOverShopOffersRotation

      public void handleGameOverShopOffersRotation(GameSystemProvider S)
    • getShopOffers

      public Array<ProgressManager.ShopOffer> getShopOffers()
    • getSecondsPlayedCorrectedForShop

      public int getSecondsPlayedCorrectedForShop()
    • generateNewShopOffers

      public void generateNewShopOffers()
    • generateNewLuckyWheel

      public void generateNewLuckyWheel()
    • getLuckyWheelOptions

      public Array<LuckyWheelOverlay.WheelOption> getLuckyWheelOptions()
    • isLuckyWheelSpinAvailable

      public boolean isLuckyWheelSpinAvailable()
      Returns:
      true, если можно крутнуть (не надо покупать)
    • getSecondsTillLuckyWheelSpinAvailable

      public int getSecondsTillLuckyWheelSpinAvailable()
      Returns:
      0 if already available
    • getLuckyWheelRespinPriceTokens

      public int getLuckyWheelRespinPriceTokens()
      Returns:
      цену покупки спина текущего колеса в токенах. Если 0, купить нельзя
    • getLuckyWheelRespinPriceAccelerators

      public int getLuckyWheelRespinPriceAccelerators()
    • getVideoAdViewBonuses

      public ProgressManager.VideoAdViewBonus[] getVideoAdViewBonuses()
    • getLootBoostTimeLeft

      public float getLootBoostTimeLeft()
    • getMaxCraftQueueSize

      public int getMaxCraftQueueSize()
    • startCrafting

      public void startCrafting(CraftRecipe recipe, Array<Item> ingredients, int count)
      Начать крафт
      Parameters:
      recipe - рецепт для крафта
      ingredients - ингридиенты по очереди (recipe.ingredients)
      count - кол-во итераций крафта
    • removeAllItems

      public void removeAllItems()
    • getAcceleratorsRequiredToShortenTime

      public int getAcceleratorsRequiredToShortenTime(float seconds)
    • getRarityFromQuality

      public static RarityType getRarityFromQuality(float quality)
    • getMinQuality

      public static float getMinQuality(RarityType rarity)
    • getMaxQuality

      public static float getMaxQuality(RarityType rarity)
    • globalQualityToRarityQualuty

      public static float globalQualityToRarityQualuty(float quality)
      quality 0.15 = COMMON с качеством (0.15 / 0.2)
    • getRarityColors

      public Color[] getRarityColors()
    • getRarityBrightColors

      public Color[] getRarityBrightColors()
    • getRarityColor

      public Color getRarityColor(RarityType rarityType)
    • getRarityIcon

      public String getRarityIcon(RarityType rarityType)
    • getRarityBrightColor

      public Color getRarityBrightColor(RarityType rarityType)
    • getRarityName

      public String getRarityName(RarityType rarityType)
    • difficultyModeAvailable

      public boolean difficultyModeAvailable(DifficultyMode mode)
    • getDifficultyMode

      public DifficultyMode getDifficultyMode()
    • setDifficultyMode

      public void setDifficultyMode(DifficultyMode mode)
    • getDifficultyModeColor

      public Color getDifficultyModeColor(DifficultyMode mode)
    • getDifficultyName

      public String getDifficultyName(DifficultyMode mode)
    • clampModeDifficulty

      public static int clampModeDifficulty(DifficultyMode mode, int setValue, @Null BasicLevel basicLevel, boolean disableResearchAndTrophies, boolean forUserMaps, ProgressManager.ProgressSnapshotForState progressSnapshot)
    • clampModeDifficultyGVP

      public static int clampModeDifficultyGVP(DifficultyMode mode, int setValue, GameValueProvider gvp)
    • getDifficultyModeDiffMultiplier

      public int getDifficultyModeDiffMultiplier(DifficultyMode mode)
    • getDifficultyModePrizeMultiplier

      public static float getDifficultyModePrizeMultiplier(DifficultyMode mode)
    • openPack

      public boolean openPack(Item item, int count, boolean showOverlay, boolean showIssuedItems)
      Returns:
      true if items were stacked
    • calculateProgressHash

      public long calculateProgressHash()
      Returns:
      отпечаток прогресса
    • existsAnyProgress

      public boolean existsAnyProgress()
      Returns:
      true, если существует хоть какой-то прогресс, который можно потерять
    • setup

      public void setup()
      Description copied from interface: Manager
      Called when all manager objects are already created and can be accessed
      Specified by:
      setup in interface Manager
      Overrides:
      setup in class Manager.ManagerAdapter
    • addListener

      public void addListener(ProgressManager.ProgressManagerListener listener)
    • removeListener

      public void removeListener(ProgressManager.ProgressManagerListener listener)
    • areModifiersOpened

      public boolean areModifiersOpened()
    • setCustomValue

      public void setCustomValue(String key, @Null String value)
      Store some custom value in the preferences
      Parameters:
      key - a string key to be used as a reference to a data
      value - string data to store for the specified key. If null is passed, a key will be removed from the saved preferences
    • getCustomValue

      @Null public String getCustomValue(String key, @Null String defaultValue)
      Retrieve custom data by the specified key
      Parameters:
      key - key
      defaultValue - value which will be returned if no data is stored for the specified key. Can be null
      Returns:
      a stored data for the specified key or defaultValue if no data is stored
    • getCustomKeys

      public String[] getCustomKeys()
      Returns:
      array of all stored custom data keys
    • isResourceOpened

      public boolean isResourceOpened(ResourceType type)
      Returns:
      true, если игрок хотя бы раз получал ресурс такого типа или есть майнер
    • getExtraDecryptingSlotsCount

      public int getExtraDecryptingSlotsCount()
    • areAbilitiesOpened

      public boolean areAbilitiesOpened()
      Returns:
      true, если у игрока уже есть доступ к кнопкам-бонусам
    • addItemToStacksArray

      public static ItemStack addItemToStacksArray(Array<ItemStack> array, Item item, int count)
      Добавить предметы в массив стеков. Если есть такой - стек увеличится, если нет, будет добавлен новый
      Returns:
      ItemStack, в который было добавлено предметы / который был создан
    • removeItemFromStacksArray

      public static ItemStack removeItemFromStacksArray(Array<ItemStack> array, Item item, int count)
      Returns:
      stack from which items were removed or null if not found or not enough items
    • getItemStackFromArray

      public static ItemStack getItemStackFromArray(Array<ItemStack> array, Item item)
    • compressStacksArray

      public static void compressStacksArray(Array<ItemStack> array)
      Объеденить стеки с одинаковыми вещами
    • addItems

      public void addItems(Item item, int count, @Null String reason)
      Добавляет вещь куда надо, в зависимости от типа. Если это набор, открывает
    • addItemStack

      public void addItemStack(ItemStack stack, @Null String reason)
    • addItemArray

      public void addItemArray(Array<ItemStack> stacks, String reason)
    • getItemsCount

      public int getItemsCount(Item item)
    • removeItems

      public boolean removeItems(Item item, int count)
    • sellItems

      public boolean sellItems(Item item, int count)
      Продать вещь
      Returns:
      true, если все вещи проданы. Если вещей не хватает или их нельзя продать, ничего не пропадет и вернет false
    • hasAnyItem

      public boolean hasAnyItem()
    • isStarred

      public boolean isStarred(Item item)
    • setStarred

      public void setStarred(Item item, boolean setStarred)
    • getItem

      public Item getItem(Item needle)
      Returns:
      item object stored in inventory - in case you need to change something in it
    • getItemsByType

      public DelayedRemovalArray<ItemStack> getItemsByType(ItemType type)
    • getItemsByCategory

      public DelayedRemovalArray<ItemStack> getItemsByCategory(ItemCategoryType categoryType)
    • getItemsBySubcategory

      public DelayedRemovalArray<ItemStack> getItemsBySubcategory(ItemSubcategoryType categoryType)
    • addResources

      public void addResources(ResourceType type, int amount, String reason)
    • setResources

      @Deprecated public void setResources(ResourceType type, int amount)
      Deprecated.
    • removeResources

      public boolean removeResources(ResourceType type, int amount)
    • getResources

      public int getResources(ResourceType type)
    • addTiles

      @Deprecated public void addTiles(Tile tile, int amount)
      Deprecated.
    • addGates

      @Deprecated public void addGates(Gate gate, int amount)
      Deprecated.
    • addAbilities

      @Deprecated public void addAbilities(AbilityType type, int amount)
      Deprecated.
    • setAbilities

      public void setAbilities(AbilityType type, int amount)
    • removeAbilities

      public boolean removeAbilities(AbilityType type, int amount)
    • getAbilities

      public int getAbilities(AbilityType type)
    • setMoney

      @Deprecated public void setMoney(int amount)
      Deprecated.
    • getGreenPapers

      public int getGreenPapers()
    • addGreenPapers

      public void addGreenPapers(int amount, String reason)
    • removeGreenPapers

      public boolean removeGreenPapers(int amount)
    • setAccelerators

      @Deprecated public void setAccelerators(int amount)
      Deprecated.
    • getAccelerators

      public int getAccelerators()
    • addAccelerators

      public void addAccelerators(int amount, String reason)
    • removeAccelerators

      public boolean removeAccelerators(int amount)
    • addIssuedPrizes

      public void addIssuedPrizes(IssuedItems issuedItems, boolean showPopup)
    • getIssuedPrizes

      public Array<IssuedItems> getIssuedPrizes()
      Returns:
      список призов, чем меньше индекс, тем свежее
    • showNewlyIssuedPrizesPopup

      public void showNewlyIssuedPrizesPopup()
      Показать всплывающие меню с полученными призами, если они есть
    • postRender

      public void postRender(float deltaTime)
      Description copied from interface: Manager
      Called after screens and systems are drawn
      Specified by:
      postRender in interface Manager
      Overrides:
      postRender in class Manager.ManagerAdapter
    • countAcceleratorsNeeded

      public int countAcceleratorsNeeded(int timeInSeconds)
      Returns:
      количество ускорителей, необходимых для ускорения времени на указанное количество секунд
    • givePendingBonuses

      public void givePendingBonuses()
      Проверить состояние игры и дать бонусы, если есть за что
    • createProgressSnapshotForState

      public ProgressManager.ProgressSnapshotForState createProgressSnapshotForState()
    • disableDoubleGainTemp

      public void disableDoubleGainTemp()
    • enableDoubleGainPermanently

      public void enableDoubleGainPermanently()
    • giveDoubleGainIfNecessary

      public void giveDoubleGainIfNecessary()
    • getTempDoubleGainDurationLeft

      public int getTempDoubleGainDurationLeft()
    • enableDoubleGainTemporary

      public boolean enableDoubleGainTemporary(int duration)
    • hasPermanentDoubleGain

      public boolean hasPermanentDoubleGain()
      Returns:
      true if player has a permanent DG enabled. Settings not considered
    • hasTemporaryDoubleGain

      public boolean hasTemporaryDoubleGain()
      Returns:
      true if player has a temporary DG enabled. Settings not considered
    • isDoubleGainEnabled

      public boolean isDoubleGainEnabled()
      Returns:
      true if permanent or temporary DG enabled. Can be disabled in settings
    • isPremiumStatusActive

      public boolean isPremiumStatusActive()
      Returns:
      true if profile has this status and it is not disabled in settings
    • getRegularRewardingAdItems

      public IssuedItems getRegularRewardingAdItems(int views)
    • getGameStartGameVersion

      public int getGameStartGameVersion()
      Returns:
      версию игры, в которой было записано первое значение в preferences
    • getGameStartTimestamp

      public int getGameStartTimestamp()
      Returns:
      время начала игры, в которой было записано первое значение в preferences
    • getGameStartHash

      public String getGameStartHash()
      Returns:
      4 or 12 (since 1.9.0) characters
    • enableDeveloperMode

      public void enableDeveloperMode()
    • isDeveloperModeEnabled

      public boolean isDeveloperModeEnabled()
    • checkSpecialTrophiesGiven

      public void checkSpecialTrophiesGiven()
      Выдать специальные трофеи, если условие выполнено и трофея еще нет
    • getInventoryStatistics

      public ProgressManager.InventoryStatistics getInventoryStatistics()
      Returns:
      current inventory statistics, not cached If generating items in a loop for further addition to the inventory, call countItem() to update the statistics