Package com.prineside.tdi2.managers
Class ProgressManager
java.lang.Object
com.prineside.tdi2.Manager.ManagerAdapter
com.prineside.tdi2.managers.ProgressManager
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable,Manager
Отвечает за основной прогресс игры (достижения, деньги, ресурсы)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic interfacestatic classstatic classstatic classNested classes/interfaces inherited from interface com.prineside.tdi2.Manager
Manager.ManagerAdapter, Manager.ManagerWithListeners<T> -
Field Summary
FieldsModifier and TypeFieldDescriptioncom.badlogic.gdx.math.RandomXS128[]com.badlogic.gdx.utils.Array<ProgressManager.CraftingQueueItem>com.badlogic.gdx.utils.Array<CaseItem>floatstatic final intstatic final intstatic final Comparator<ItemStack>floatfloatfloatbooleanbooleancom.badlogic.gdx.math.RandomXS128com.badlogic.gdx.math.RandomXS128com.badlogic.gdx.math.RandomXS128static final com.badlogic.gdx.graphics.Color[]static final com.badlogic.gdx.graphics.Color[]static final intstatic final intstatic final intintint -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAbilities(AbilityType type, int amount) voidaddAccelerators(int amount) voidvoidaddGreenPapers(int amount) voidaddIssuedPrizes(IssuedItems issuedItems, boolean showPopup) voidvoidДобавляет вещь куда надо, в зависимости от типа.voidstatic ItemStackaddItemToStacksArray(com.badlogic.gdx.utils.Array<ItemStack> array, Item item, int count) Добавить предметы в массив стеков.voidvoidaddResources(ResourceType type, int amount) voidbooleanbooleanbooleanlongvoidcancelCrafting(int queueIdx) Отменить крафт (будет вызван grabCrafted и возвращены предметы, которые еще не ушли на крафт)voidВыдать специальные трофеи, если условие выполнено и трофея еще нетstatic intclampModeDifficulty(DifficultyMode mode, int setValue, GameValueProvider gvp) voidclearDecryptingQueue(int idx) static voidcompressStacksArray(com.badlogic.gdx.utils.Array<ItemStack> array) Объеденить стеки с одинаковыми вещамиintcountAcceleratorsNeeded(int timeInSeconds) booleanvoidvoiddispose()Releases all resources of this object.voidvoidbooleanenableDoubleGainTemporary(int duration) booleanvoidЗавершить крафт с помощью ускорителейvoidvoidintgetAbilities(AbilityType type) intintgetAcceleratorsRequiredToShortenTime(float seconds) com.badlogic.gdx.utils.DelayedRemovalArray<ItemStack>getCraftingQueueItem(int idx) com.badlogic.gdx.graphics.Colorintfloatintintintcom.badlogic.gdx.utils.Array<IssuedItems>com.badlogic.gdx.utils.DelayedRemovalArray<ItemStack>getItemsByCategory(ItemCategoryType categoryType) com.badlogic.gdx.utils.DelayedRemovalArray<ItemStack>getItemsBySubcategory(ItemSubcategoryType categoryType) com.badlogic.gdx.utils.DelayedRemovalArray<ItemStack>getItemsByType(ItemType type) intgetItemsCount(Item item) floatcom.badlogic.gdx.utils.Array<LuckyWheelOverlay.WheelOption>intintintintstatic floatgetMaxQuality(RarityType rarity) static floatgetMinQuality(RarityType rarity) com.badlogic.gdx.graphics.ColorgetRarityBrightColor(RarityType rarityType) com.badlogic.gdx.graphics.ColorgetRarityColor(RarityType rarityType) static RarityTypegetRarityFromQuality(float quality) getRarityIcon(RarityType rarityType) getRarityName(RarityType rarityType) getRegularRewardingAdItems(int views) intgetResources(ResourceType type) com.badlogic.gdx.utils.Array<ProgressManager.ShopOffer>intfloatvoidvoidПроверить состояние игры и дать бонусы, если есть за чтоstatic floatglobalQualityToRarityQualuty(float quality) quality 0.15 = COMMON с качеством (0.15 / 0.2)voidСобрать скрафченное со всех элементов очередиbooleangrabCrafted(int queueIdx) Собрать скрафченные вещиbooleanbooleanbooleanbooleanbooleanbooleanbooleanisResourceOpened(ResourceType type) booleanvoidpostRender(float deltaTime) Вызывается после отрисовки и обновления экранаbooleanremoveAbilities(AbilityType type, int amount) booleanremoveAccelerators(int amount) voidbooleanremoveGreenPapers(int amount) booleanremoveItems(Item item, int count) voidbooleanremoveResources(ResourceType type, int amount) voidvoidsave()voidbooleanПродать вещьvoidsetAbilities(AbilityType type, int amount) voidsetAccelerators(int amount) voidvoidsetMoney(int amount) voidsetResources(ResourceType type, int amount) voidsetup()Вызывается, когда объекты всех менеджеров созданы и можно к ним обращатьсяvoidПоказать всплывающие меню с полученными призами, если они естьvoidstartCrafting(CraftRecipe recipe, com.badlogic.gdx.utils.Array<Item> ingredients, int count) Начать крафтbooleanstartDecryptingCase(CaseType caseType) voidMethods inherited from class com.prineside.tdi2.Manager.ManagerAdapter
clearPools, preRender, test
-
Field Details
-
VIDEO_WATCHES_FOR_DOUBLE_GAIN
public static final int VIDEO_WATCHES_FOR_DOUBLE_GAIN- See Also:
-
VIDEO_WATCHES_FOR_LUCKY_SHOT
public static final int VIDEO_WATCHES_FOR_LUCKY_SHOT- See Also:
-
DIFFICULTY_MULTIPLIER_EASY
public static final int DIFFICULTY_MULTIPLIER_EASY- See Also:
-
DIFFICULTY_MULTIPLIER_NORMAL
public static final int DIFFICULTY_MULTIPLIER_NORMAL- See Also:
-
caseRandoms
public com.badlogic.gdx.math.RandomXS128[] caseRandoms -
otherItemsRandom
public com.badlogic.gdx.math.RandomXS128 otherItemsRandom -
decryptingCase
-
decryptingCaseQueue
-
decryptingCaseTimeLeft
public float decryptingCaseTimeLeft -
lootBoostTimeLeft
public float lootBoostTimeLeft -
craftingQueue
-
ITEM_RARITY_COMPARATOR
-
RARITY_COLORS
public static final com.badlogic.gdx.graphics.Color[] RARITY_COLORS -
RARITY_BRIGHT_COLORS
public static final com.badlogic.gdx.graphics.Color[] RARITY_BRIGHT_COLORS -
videoAdViewBonuses
-
luckyWheelSpinAvailable
public boolean luckyWheelSpinAvailable -
luckyWheelSpinInProgress
public boolean luckyWheelSpinInProgress -
luckyWheelLastRotation
public float luckyWheelLastRotation -
luckyWheelLastWeaponAngle
public float luckyWheelLastWeaponAngle -
luckyWheelWheelRandom
public com.badlogic.gdx.math.RandomXS128 luckyWheelWheelRandom -
luckyWheelSpinRandom
public com.badlogic.gdx.math.RandomXS128 luckyWheelSpinRandom -
videosWatchedForDoubleGain
public int videosWatchedForDoubleGain -
videosWatchedForLuckyShot
public int videosWatchedForLuckyShot -
VIDEO_AD_BONUSES_CYCLE_LENGTH
public static final int VIDEO_AD_BONUSES_CYCLE_LENGTH- See Also:
-
-
Constructor Details
-
ProgressManager
public ProgressManager()
-
-
Method Details
-
getShopOffers
-
generateNewShopOffers
public void generateNewShopOffers() -
generateNewLuckyWheel
public void generateNewLuckyWheel() -
getLuckyWheelOptions
-
isLuckyWheelSpinAvailable
public boolean isLuckyWheelSpinAvailable()- Returns:
- true, если можно крутнуть (не надо покупать)
-
getLuckyWheelRespinPriceTokens
public int getLuckyWheelRespinPriceTokens()- Returns:
- цену покупки спина текущего колеса в токенах. Если 0, купить нельзя
-
getLuckyWheelRespinPriceAccelerators
public int getLuckyWheelRespinPriceAccelerators() -
getVideoAdViewBonuses
-
getLootBoostTimeLeft
public float getLootBoostTimeLeft() -
getCraftingQueueItem
-
updateNativeNotifications
public void updateNativeNotifications() -
cancelCrafting
public void cancelCrafting(int queueIdx) Отменить крафт (будет вызван grabCrafted и возвращены предметы, которые еще не ушли на крафт) -
grabCrafted
public boolean grabCrafted(int queueIdx) Собрать скрафченные вещи- Returns:
- true, если крафт в слоте закончился
-
grabCrafted
public void grabCrafted()Собрать скрафченное со всех элементов очереди -
getMaxCraftQueueSize
public int getMaxCraftQueueSize() -
startCrafting
public void startCrafting(CraftRecipe recipe, com.badlogic.gdx.utils.Array<Item> ingredients, int count) Начать крафт- Parameters:
recipe- рецепт для крафтаingredients- ингридиенты по очереди (recipe.ingredients)count- кол-во итераций крафта
-
finishCraftingNow
public void finishCraftingNow()Завершить крафт с помощью ускорителей -
getTotalCraftingTimeLeft
public float getTotalCraftingTimeLeft() -
removeAllItems
public void removeAllItems() -
getAcceleratorsRequiredToShortenTime
public int getAcceleratorsRequiredToShortenTime(float seconds) -
getRarityFromQuality
-
getMinQuality
-
getMaxQuality
-
globalQualityToRarityQualuty
public static float globalQualityToRarityQualuty(float quality) quality 0.15 = COMMON с качеством (0.15 / 0.2) -
getRarityColor
-
getRarityIcon
-
getRarityBrightColor
-
getRarityName
-
difficultyModeAvailable
-
getDifficultyMode
-
setDifficultyMode
-
getDifficultyModeColor
-
getDifficultyName
-
clampModeDifficulty
-
getDifficultyModeDiffMultiplier
-
getDifficultyModePrizeMultiplier
-
requireDelayedSave
public void requireDelayedSave() -
openPack
- Returns:
- true if items were stacked
-
clearDecryptingQueue
public void clearDecryptingQueue(int idx) -
startDecryptingCase
-
calculateProgressHash
public long calculateProgressHash()- Returns:
- отпечаток прогресса
-
existsAnyProgress
public boolean existsAnyProgress()- Returns:
- true, если существует хоть какой-то прогресс, который можно потерять
-
setup
public void setup()Description copied from interface:ManagerВызывается, когда объекты всех менеджеров созданы и можно к ним обращаться- Specified by:
setupin interfaceManager- Overrides:
setupin classManager.ManagerAdapter
-
addListener
-
removeListener
-
areModifiersOpened
public boolean areModifiersOpened() -
isResourceOpened
- Returns:
- true, если игрок хотя бы раз получал ресурс такого типа или есть майнер
-
getExtraDecryptingSlotsCount
public int getExtraDecryptingSlotsCount() -
areAbilitiesOpened
public boolean areAbilitiesOpened()- Returns:
- true, если у игрока уже есть доступ к кнопкам-бонусам
-
addItemToStacksArray
public static ItemStack addItemToStacksArray(com.badlogic.gdx.utils.Array<ItemStack> array, Item item, int count) Добавить предметы в массив стеков. Если есть такой - стек увеличится, если нет, будет добавлен новый- Returns:
- ItemStack, в который было добавлено предметы / который был создан
-
compressStacksArray
Объеденить стеки с одинаковыми вещами -
addItems
Добавляет вещь куда надо, в зависимости от типа. Если это набор, открывает -
getMaxEncryptedCasesInInventory
public int getMaxEncryptedCasesInInventory() -
getEncryptedCasesCount
public int getEncryptedCasesCount() -
addItems
-
addItems
-
getItemsCount
-
removeItems
-
sellItems
Продать вещь- Returns:
- true, если все вещи проданы. Если вещей не хватает или их нельзя продать, ничего не пропадет и вернет false
-
getAllItems
-
getItem
- Returns:
- item object stored in inventory - in case you need to change something in it
-
getItemsByType
-
getItemsByCategory
public com.badlogic.gdx.utils.DelayedRemovalArray<ItemStack> getItemsByCategory(ItemCategoryType categoryType) -
getItemsBySubcategory
public com.badlogic.gdx.utils.DelayedRemovalArray<ItemStack> getItemsBySubcategory(ItemSubcategoryType categoryType) -
addResources
-
setResources
-
removeResources
-
getResources
-
addTiles
-
addGates
-
addAbilities
-
setAbilities
-
removeAbilities
-
getAbilities
-
setMoney
public void setMoney(int amount) -
getGreenPapers
public int getGreenPapers() -
addGreenPapers
public void addGreenPapers(int amount) -
removeGreenPapers
public boolean removeGreenPapers(int amount) -
setAccelerators
public void setAccelerators(int amount) -
getAccelerators
public int getAccelerators() -
addAccelerators
public void addAccelerators(int amount) -
removeAccelerators
public boolean removeAccelerators(int amount) -
addIssuedPrizes
-
getIssuedPrizes
- Returns:
- список призов, чем меньше индекс, тем свежее
-
showNewlyIssuedPrizesPopup
public void showNewlyIssuedPrizesPopup()Показать всплывающие меню с полученными призами, если они есть -
countAcceleratorsNeeded
public int countAcceleratorsNeeded(int timeInSeconds) - Returns:
- количество ускорителей, необходимых для ускорения времени на указанное количество секунд
-
givePendingBonuses
public void givePendingBonuses()Проверить состояние игры и дать бонусы, если есть за что -
disableDoubleGainTemp
public void disableDoubleGainTemp() -
enableDoubleGainPermanently
public void enableDoubleGainPermanently() -
giveDoubleGainIfNecessary
public void giveDoubleGainIfNecessary() -
getTempDoubleGainDurationLeft
public int getTempDoubleGainDurationLeft() -
enableDoubleGainTemporary
public boolean enableDoubleGainTemporary(int duration) -
areF2pTimersDisabled
public boolean areF2pTimersDisabled() -
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
-
enableDeveloperMode
public void enableDeveloperMode() -
isDeveloperModeEnabled
public boolean isDeveloperModeEnabled() -
checkSpecialTrophiesGiven
public void checkSpecialTrophiesGiven()Выдать специальные трофеи, если условие выполнено и трофея еще нет -
save
public void save() -
postRender
public void postRender(float deltaTime) Description copied from interface:ManagerВызывается после отрисовки и обновления экрана- Specified by:
postRenderin interfaceManager- Overrides:
postRenderin classManager.ManagerAdapter
-
saveIfRequired
public void saveIfRequired() -
getInventoryStatistics
- Returns:
- cache object of current inventory statistics. If generating items in a loop for further addition to the inventory, call countItem() to update the statistics !!! Preferably call cpy() before modifying
-
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- Overrides:
disposein classManager.ManagerAdapter
-