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 class
static class
static interface
static class
static class
static class
Nested 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>
float
static final int
static final int
static final Comparator<ItemStack>
float
float
float
boolean
boolean
com.badlogic.gdx.math.RandomXS128
com.badlogic.gdx.math.RandomXS128
com.badlogic.gdx.math.RandomXS128
static final com.badlogic.gdx.graphics.Color[]
static final com.badlogic.gdx.graphics.Color[]
static final int
static final int
static final int
int
int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAbilities
(AbilityType type, int amount) void
addAccelerators
(int amount) void
void
addGreenPapers
(int amount) void
addIssuedPrizes
(IssuedItems issuedItems, boolean showPopup) void
void
Добавляет вещь куда надо, в зависимости от типа.void
static ItemStack
addItemToStacksArray
(com.badlogic.gdx.utils.Array<ItemStack> array, Item item, int count) Добавить предметы в массив стеков.void
void
addResources
(ResourceType type, int amount) void
boolean
boolean
boolean
long
void
cancelCrafting
(int queueIdx) Отменить крафт (будет вызван grabCrafted и возвращены предметы, которые еще не ушли на крафт)void
Выдать специальные трофеи, если условие выполнено и трофея еще нетstatic int
clampModeDifficulty
(DifficultyMode mode, int setValue, GameValueProvider gvp) void
clearDecryptingQueue
(int idx) static void
compressStacksArray
(com.badlogic.gdx.utils.Array<ItemStack> array) Объеденить стеки с одинаковыми вещамиint
countAcceleratorsNeeded
(int timeInSeconds) boolean
void
void
dispose()
Releases all resources of this object.void
void
boolean
enableDoubleGainTemporary
(int duration) boolean
void
Завершить крафт с помощью ускорителейvoid
void
int
getAbilities
(AbilityType type) int
int
getAcceleratorsRequiredToShortenTime
(float seconds) com.badlogic.gdx.utils.DelayedRemovalArray<ItemStack>
getCraftingQueueItem
(int idx) com.badlogic.gdx.graphics.Color
int
float
int
int
int
com.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) int
getItemsCount
(Item item) float
com.badlogic.gdx.utils.Array<LuckyWheelOverlay.WheelOption>
int
int
int
int
static float
getMaxQuality
(RarityType rarity) static float
getMinQuality
(RarityType rarity) com.badlogic.gdx.graphics.Color
getRarityBrightColor
(RarityType rarityType) com.badlogic.gdx.graphics.Color
getRarityColor
(RarityType rarityType) static RarityType
getRarityFromQuality
(float quality) getRarityIcon
(RarityType rarityType) getRarityName
(RarityType rarityType) getRegularRewardingAdItems
(int views) int
getResources
(ResourceType type) com.badlogic.gdx.utils.Array<ProgressManager.ShopOffer>
int
float
void
void
Проверить состояние игры и дать бонусы, если есть за чтоstatic float
globalQualityToRarityQualuty
(float quality) quality 0.15 = COMMON с качеством (0.15 / 0.2)void
Собрать скрафченное со всех элементов очередиboolean
grabCrafted
(int queueIdx) Собрать скрафченные вещиboolean
boolean
boolean
boolean
boolean
boolean
boolean
isResourceOpened
(ResourceType type) boolean
void
postRender
(float deltaTime) Вызывается после отрисовки и обновления экранаboolean
removeAbilities
(AbilityType type, int amount) boolean
removeAccelerators
(int amount) void
boolean
removeGreenPapers
(int amount) boolean
removeItems
(Item item, int count) void
boolean
removeResources
(ResourceType type, int amount) void
void
save()
void
boolean
Продать вещьvoid
setAbilities
(AbilityType type, int amount) void
setAccelerators
(int amount) void
void
setMoney
(int amount) void
setResources
(ResourceType type, int amount) void
setup()
Вызывается, когда объекты всех менеджеров созданы и можно к ним обращатьсяvoid
Показать всплывающие меню с полученными призами, если они естьvoid
startCrafting
(CraftRecipe recipe, com.badlogic.gdx.utils.Array<Item> ingredients, int count) Начать крафтboolean
startDecryptingCase
(CaseType caseType) void
Methods 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:
setup
in interfaceManager
- Overrides:
setup
in 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:
postRender
in interfaceManager
- Overrides:
postRender
in 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.Disposable
Releases all resources of this object.- Specified by:
dispose
in interfacecom.badlogic.gdx.utils.Disposable
- Overrides:
dispose
in classManager.ManagerAdapter
-