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 class
static interface
static final class
Contains progress data necessary for a proper replay validation.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 TypeFieldDescriptionstatic final ProgressManager.ConditionalCompensation[]
static final int
static final int
static final String
static final Comparator<? super ItemStack>
static final int
static final int
static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAbilities
(AbilityType type, int amount) Deprecated.void
addAccelerators
(int amount, String reason) void
Deprecated.void
addGreenPapers
(int amount, String reason) 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, String reason) void
Deprecated.boolean
boolean
long
void
Выдать специальные трофеи, если условие выполнено и трофея еще нетstatic int
clampModeDifficulty
(DifficultyMode mode, int setValue, BasicLevel basicLevel, boolean disableResearchAndTrophies, boolean forUserMaps, ProgressManager.ProgressSnapshotForState progressSnapshot) static int
clampModeDifficulty
(DifficultyMode mode, int setValue, GameValueProvider gvp) static void
compressStacksArray
(com.badlogic.gdx.utils.Array<ItemStack> array) Объеденить стеки с одинаковыми вещамиint
countAcceleratorsNeeded
(int timeInSeconds) boolean
void
void
void
boolean
enableDoubleGainTemporary
(int duration) boolean
void
void
int
getAbilities
(AbilityType type) int
int
getAcceleratorsRequiredToShortenTime
(float seconds) com.badlogic.gdx.graphics.Color
int
float
int
int
int
int
int
com.badlogic.gdx.utils.Array<IssuedItems>
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) static ItemStack
getItemStackFromArray
(com.badlogic.gdx.utils.Array<ItemStack> array, 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[]
com.badlogic.gdx.graphics.Color
getRarityColor
(RarityType rarityType) com.badlogic.gdx.graphics.Color[]
static RarityType
getRarityFromQuality
(float quality) getRarityIcon
(RarityType rarityType) getRarityName
(RarityType rarityType) getRegularRewardingAdItems
(int views) int
getResources
(ResourceType type) int
com.badlogic.gdx.utils.Array<ProgressManager.ShopOffer>
int
void
void
Проверить состояние игры и дать бонусы, если есть за чтоstatic float
globalQualityToRarityQualuty
(float quality) quality 0.15 = COMMON с качеством (0.15 / 0.2)boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
isResourceOpened
(ResourceType type) boolean
boolean
void
postRender
(float deltaTime) Вызывается после отрисовки и обновления экранаboolean
removeAbilities
(AbilityType type, int amount) boolean
removeAccelerators
(int amount) void
boolean
removeGreenPapers
(int amount) void
static ItemStack
removeItemFromStacksArray
(com.badlogic.gdx.utils.Array<ItemStack> array, Item item, int count) boolean
removeItems
(Item item, int count) void
boolean
removeResources
(ResourceType type, int amount) boolean
Продать вещьvoid
setAbilities
(AbilityType type, int amount) void
setAccelerators
(int amount) Deprecated.void
void
setMoney
(int amount) Deprecated.void
setResources
(ResourceType type, int amount) Deprecated.void
setStarred
(Item item, boolean setStarred) void
setup()
Вызывается, когда объекты всех менеджеров созданы и можно к ним обращатьсяvoid
Показать всплывающие меню с полученными призами, если они естьvoid
startCrafting
(CraftRecipe recipe, com.badlogic.gdx.utils.Array<Item> ingredients, int count) Начать крафтMethods inherited from class com.prineside.tdi2.Manager.ManagerAdapter
clearPools, dispose, preRender, test
-
Field Details
-
ISSUED_ITEMS_LOG_FILE
- See Also:
-
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:
-
CONDITIONAL_COMPENSATIONS
-
ITEM_RARITY_COMPARATOR
-
videoAdViewBonuses
-
VIDEO_AD_BONUSES_CYCLE_LENGTH
public static final int VIDEO_AD_BONUSES_CYCLE_LENGTH- See Also:
-
-
Constructor Details
-
ProgressManager
public ProgressManager()
-
-
Method Details
-
removeIssuedItemsLog
public void removeIssuedItemsLog() -
getIssuedItems
-
getShopOffers
-
generateNewShopOffers
public void generateNewShopOffers() -
generateNewLuckyWheel
public void generateNewLuckyWheel() -
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
-
getLootBoostTimeLeft
public float getLootBoostTimeLeft() -
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
- кол-во итераций крафта
-
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) -
getRarityColors
public com.badlogic.gdx.graphics.Color[] getRarityColors() -
getRarityBrightColors
public com.badlogic.gdx.graphics.Color[] getRarityBrightColors() -
getRarityColor
-
getRarityIcon
-
getRarityBrightColor
-
getRarityName
-
difficultyModeAvailable
-
getDifficultyMode
-
setDifficultyMode
-
getDifficultyModeColor
-
getDifficultyName
-
clampModeDifficulty
public static int clampModeDifficulty(DifficultyMode mode, int setValue, @Null BasicLevel basicLevel, boolean disableResearchAndTrophies, boolean forUserMaps, ProgressManager.ProgressSnapshotForState progressSnapshot) -
clampModeDifficulty
-
getDifficultyModeDiffMultiplier
-
getDifficultyModePrizeMultiplier
-
openPack
- 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
Вызывается, когда объекты всех менеджеров созданы и можно к ним обращаться- 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, в который было добавлено предметы / который был создан
-
removeItemFromStacksArray
public static ItemStack removeItemFromStacksArray(com.badlogic.gdx.utils.Array<ItemStack> array, Item item, int count) - Returns:
- stack from which items were removed or null if not found or not enough items
-
getItemStackFromArray
-
compressStacksArray
Объеденить стеки с одинаковыми вещами -
addItems
Добавляет вещь куда надо, в зависимости от типа. Если это набор, открывает -
getMaxEncryptedCasesInInventory
public int getMaxEncryptedCasesInInventory() -
getEncryptedCasesCount
public int getEncryptedCasesCount() -
addItems
-
addItems
-
getItemsCount
-
removeItems
-
sellItems
Продать вещь- Returns:
- true, если все вещи проданы. Если вещей не хватает или их нельзя продать, ничего не пропадет и вернет false
-
hasAnyItem
public boolean hasAnyItem() -
isStarred
-
setStarred
-
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
Deprecated. -
removeResources
-
getResources
-
addTiles
Deprecated. -
addGates
Deprecated. -
addAbilities
Deprecated. -
setAbilities
-
removeAbilities
-
getAbilities
-
setMoney
Deprecated. -
getGreenPapers
public int getGreenPapers() -
addGreenPapers
-
removeGreenPapers
public boolean removeGreenPapers(int amount) -
setAccelerators
Deprecated. -
getAccelerators
public int getAccelerators() -
addAccelerators
-
removeAccelerators
public boolean removeAccelerators(int amount) -
addIssuedPrizes
-
getIssuedPrizes
- Returns:
- список призов, чем меньше индекс, тем свежее
-
showNewlyIssuedPrizesPopup
public void showNewlyIssuedPrizesPopup()Показать всплывающие меню с полученными призами, если они есть -
postRender
public void postRender(float deltaTime) Description copied from interface:Manager
Вызывается после отрисовки и обновления экрана- Specified by:
postRender
in interfaceManager
- Overrides:
postRender
in classManager.ManagerAdapter
-
countAcceleratorsNeeded
public int countAcceleratorsNeeded(int timeInSeconds) - Returns:
- количество ускорителей, необходимых для ускорения времени на указанное количество секунд
-
givePendingBonuses
public void givePendingBonuses()Проверить состояние игры и дать бонусы, если есть за что -
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
-
getGameStartGameVersion
public int getGameStartGameVersion()- Returns:
- версию игры, в которой было записано первое значение в preferences
-
getGameStartTimestamp
public int getGameStartTimestamp()- Returns:
- время начала игры, в которой было записано первое значение в preferences
-
getGameStartHash
- Returns:
- 4 or 12 (since 1.9.0) characters
-
enableDeveloperMode
public void enableDeveloperMode() -
isDeveloperModeEnabled
public boolean isDeveloperModeEnabled() -
checkSpecialTrophiesGiven
public void checkSpecialTrophiesGiven()Выдать специальные трофеи, если условие выполнено и трофея еще нет -
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
-