@jeremyckahn/farmhand 1.19.19 → 1.19.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{index-BxA2fVaN.js → index-CG_lY1MJ.js} +9 -9
- package/dist/assets/{index-BxA2fVaN.js.map → index-CG_lY1MJ.js.map} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/dist/service-worker.js.map +1 -1
- package/package.json +3 -2
- package/src/common/services/{randomNumber.js → randomNumber.ts} +1 -0
- package/src/common/{utils.js → utils.ts} +1 -1
- package/src/components/AccountingView/{AccountingView.js → AccountingView.tsx} +1 -0
- package/src/components/AchievementsView/{AchievementsView.js → AchievementsView.tsx} +6 -4
- package/src/components/AnimatedNumber/{AnimatedNumber.js → AnimatedNumber.tsx} +9 -6
- package/src/components/AppBar/{AppBar.js → AppBar.tsx} +5 -2
- package/src/components/BailOutErrorBoundary/{BailOutErrorBoundary.js → BailOutErrorBoundary.tsx} +2 -0
- package/src/components/Cellar/{CellarInventoryTabPanel.js → CellarInventoryTabPanel.tsx} +2 -0
- package/src/components/Cellar/{Keg.js → Keg.tsx} +0 -1
- package/src/components/ContextPane/{ContextPane.test.js → ContextPane.test.tsx} +3 -0
- package/src/components/ContextPane/{ContextPane.js → ContextPane.tsx} +2 -0
- package/src/components/CowCard/Bloodline/{Bloodline.test.js → Bloodline.test.tsx} +6 -3
- package/src/components/CowCard/{CowCard.js → CowCard.tsx} +6 -4
- package/src/components/CowCard/Subheader/{Subheader.js → Subheader.tsx} +1 -0
- package/src/components/CowPen/{Cow.js → Cow.tsx} +27 -13
- package/src/components/CowPen/{CowPen.test.js → CowPen.test.tsx} +15 -1
- package/src/components/CowPen/{Tumbleweeds.js → Tumbleweeds.tsx} +2 -1
- package/src/components/Farmhand/{Farmhand.context.js → Farmhand.context.tsx} +2 -2
- package/src/components/Farmhand/{Farmhand.js → Farmhand.tsx} +91 -24
- package/src/components/FermentationRecipeList/{FermentationRecipe.js → FermentationRecipe.tsx} +4 -3
- package/src/components/FermentationRecipeList/{FermentationRecipeList.test.js → FermentationRecipeList.test.tsx} +5 -0
- package/src/components/FermentationRecipeList/{FermentationRecipeList.js → FermentationRecipeList.tsx} +3 -0
- package/src/components/Field/{Field.test.js → Field.test.tsx} +2 -3
- package/src/components/Field/{Field.js → Field.tsx} +23 -18
- package/src/components/Home/{Home.js → Home.tsx} +1 -0
- package/src/components/Home/{SnowBackground.js → SnowBackground.tsx} +2 -0
- package/src/components/Inventory/{Inventory.js → Inventory.tsx} +33 -25
- package/src/components/Item/{Item.js → Item.tsx} +2 -1
- package/src/components/LogView/{LogView.js → LogView.tsx} +23 -18
- package/src/components/Navigation/{Navigation.js → Navigation.tsx} +5 -6
- package/src/components/NotificationSystem/{NotificationSystem.js → NotificationSystem.tsx} +0 -1
- package/src/components/OnlinePeersView/{OnlinePeersView.js → OnlinePeersView.tsx} +7 -4
- package/src/components/Plot/{Plot.test.js → Plot.test.tsx} +8 -8
- package/src/components/Plot/{Plot.js → Plot.tsx} +5 -0
- package/src/components/PriceEventView/{PriceEventView.test.js → PriceEventView.test.tsx} +1 -0
- package/src/components/ProgressBar/{ProgressBar.js → ProgressBar.tsx} +2 -0
- package/src/components/QuantityInput/{QuantityInput.js → QuantityInput.tsx} +1 -0
- package/src/components/Recipe/{Recipe.js → Recipe.tsx} +1 -2
- package/src/components/SettingsView/{RandomSeedInput.js → RandomSeedInput.tsx} +1 -1
- package/src/components/Shop/{Shop.js → Shop.tsx} +2 -1
- package/src/components/Stage/{Stage.test.js → Stage.test.tsx} +1 -0
- package/src/components/Stage/{Stage.js → Stage.tsx} +6 -3
- package/src/components/TierPurchase/{TierPurchase.js → TierPurchase.tsx} +3 -3
- package/src/components/Toolbelt/{Toolbelt.js → Toolbelt.tsx} +3 -0
- package/src/components/UpgradePurchase/{UpgradePurchase.js → UpgradePurchase.tsx} +0 -1
- package/src/components/WineRecipeList/{WineRecipe.test.js → WineRecipe.test.tsx} +10 -1
- package/src/components/WineRecipeList/{WineRecipe.js → WineRecipe.tsx} +2 -1
- package/src/components/WineRecipeList/{WineRecipeList.js → WineRecipeList.tsx} +1 -0
- package/src/components/Workshop/{ForgeTabPanel.js → ForgeTabPanel.tsx} +1 -0
- package/src/components/Workshop/{Workshop.test.js → Workshop.test.tsx} +2 -2
- package/src/components/Workshop/{getUpgradesAvailable.test.js → getUpgradesAvailable.test.ts} +1 -0
- package/src/components/Workshop/{getUpgradesAvailable.js → getUpgradesAvailable.ts} +2 -0
- package/src/{constants.js → constants.ts} +2 -2
- package/src/data/{achievements.test.js → achievements.test.ts} +2 -1
- package/src/data/{achievements.js → achievements.ts} +9 -0
- package/src/data/{crop.js → crop.ts} +5 -4
- package/src/data/crops/{asparagus.js → asparagus.ts} +2 -0
- package/src/data/crops/{carrot.js → carrot.ts} +2 -0
- package/src/data/crops/{corn.js → corn.ts} +2 -0
- package/src/data/crops/{garlic.js → garlic.ts} +2 -0
- package/src/data/crops/{grape.js → grape.ts} +11 -7
- package/src/data/crops/{jalapeno.js → jalapeno.ts} +2 -0
- package/src/data/crops/{olive.js → olive.ts} +2 -0
- package/src/data/crops/{onion.js → onion.ts} +2 -0
- package/src/data/crops/{pea.js → pea.ts} +2 -0
- package/src/data/crops/{potato.js → potato.ts} +2 -0
- package/src/data/crops/{pumpkin.js → pumpkin.ts} +2 -0
- package/src/data/crops/{soybean.js → soybean.ts} +2 -0
- package/src/data/crops/{spinach.js → spinach.ts} +2 -0
- package/src/data/crops/{strawberry.js → strawberry.ts} +2 -0
- package/src/data/crops/{sunflower.js → sunflower.ts} +2 -0
- package/src/data/crops/{sweet-potato.js → sweet-potato.ts} +2 -0
- package/src/data/crops/{tomato.js → tomato.ts} +2 -0
- package/src/data/crops/{watermelon.js → watermelon.ts} +2 -0
- package/src/data/crops/{wheat.js → wheat.ts} +2 -0
- package/src/data/{items.js → items.ts} +12 -12
- package/src/data/{levels.js → levels.ts} +28 -0
- package/src/data/{maps.js → maps.ts} +2 -1
- package/src/data/ores/{bronzeOre.js → bronzeOre.ts} +1 -1
- package/src/data/ores/{coal.js → coal.ts} +1 -1
- package/src/data/ores/{goldOre.js → goldOre.ts} +1 -1
- package/src/data/ores/{ironOre.js → ironOre.ts} +1 -1
- package/src/data/ores/{saltRock.js → saltRock.ts} +1 -1
- package/src/data/ores/{silverOre.js → silverOre.ts} +1 -1
- package/src/data/ores/{stone.js → stone.ts} +1 -1
- package/src/data/{recipes.js → recipes.ts} +43 -43
- package/src/data/{upgrades.js → upgrades.ts} +4 -4
- package/src/{enums.js → enums.ts} +28 -28
- package/src/factories/{CoalFactory.js → CoalFactory.ts} +2 -0
- package/src/factories/{OreFactory.js → OreFactory.ts} +3 -0
- package/src/factories/{ResourceFactory.test.js → ResourceFactory.test.ts} +4 -0
- package/src/factories/{ResourceFactory.js → ResourceFactory.ts} +4 -0
- package/src/factories/{StoneFactory.js → StoneFactory.ts} +1 -0
- package/src/{fetch-utils.js → fetch-utils.ts} +2 -0
- package/src/game-logic/{field-purchase.test.js → field-purchase.test.ts} +4 -2
- package/src/game-logic/reducers/{applyCrows.js → applyCrows.ts} +3 -0
- package/src/game-logic/reducers/{applyLoanInterest.js → applyLoanInterest.ts} +1 -1
- package/src/game-logic/reducers/{applyPrecipitation.js → applyPrecipitation.ts} +6 -6
- package/src/game-logic/reducers/{changeCowAutomaticHugState.js → changeCowAutomaticHugState.ts} +2 -2
- package/src/game-logic/reducers/{computeStateForNextDay.js → computeStateForNextDay.ts} +2 -2
- package/src/game-logic/reducers/{consumeIngredients.js → consumeIngredients.ts} +2 -2
- package/src/game-logic/reducers/{harvestPlot.js → harvestPlot.ts} +4 -4
- package/src/game-logic/reducers/{makeFermentationRecipe.js → makeFermentationRecipe.ts} +1 -0
- package/src/game-logic/reducers/{makeRecipe.test.js → makeRecipe.test.ts} +11 -8
- package/src/game-logic/reducers/{makeWine.test.js → makeWine.test.ts} +0 -2
- package/src/game-logic/reducers/{makeWine.js → makeWine.ts} +1 -0
- package/src/game-logic/reducers/{minePlot.js → minePlot.ts} +1 -0
- package/src/game-logic/reducers/{processCellarSpoilage.test.js → processCellarSpoilage.test.ts} +0 -5
- package/src/game-logic/reducers/{processCellarSpoilage.js → processCellarSpoilage.ts} +0 -1
- package/src/game-logic/reducers/{processCowFertilizerProduction.js → processCowFertilizerProduction.ts} +1 -1
- package/src/game-logic/reducers/{processLevelUp.js → processLevelUp.ts} +3 -0
- package/src/game-logic/reducers/{purchaseField.test.js → purchaseField.test.ts} +2 -0
- package/src/game-logic/reducers/{purchaseField.js → purchaseField.ts} +3 -2
- package/src/game-logic/reducers/{purchaseForest.test.js → purchaseForest.test.tsx} +6 -2
- package/src/game-logic/reducers/{purchaseForest.js → purchaseForest.ts} +3 -2
- package/src/game-logic/reducers/{rotateNotificationLogs.js → rotateNotificationLogs.ts} +1 -1
- package/src/game-logic/reducers/{sellCow.test.js → sellCow.test.ts} +3 -3
- package/src/game-logic/reducers/{sellItem.test.js → sellItem.test.ts} +0 -3
- package/src/game-logic/reducers/{sellKeg.js → sellKeg.ts} +0 -1
- package/src/game-logic/reducers/{spawnWeeds.js → spawnWeeds.ts} +1 -0
- package/src/game-logic/reducers/{updateAchievements.js → updateAchievements.ts} +10 -9
- package/src/game-logic/reducers/{updatePeer.test.js → updatePeer.test.ts} +0 -4
- package/src/game-logic/reducers/{updatePeer.js → updatePeer.ts} +1 -0
- package/src/game-logic/reducers/{updatePlotShoveledState.test.js → updatePlotShoveledState.test.ts} +0 -1
- package/src/handlers/{peer-events.js → peer-events.ts} +9 -3
- package/src/handlers/{ui-events.test.js → ui-events.test.ts} +2 -0
- package/src/handlers/{ui-events.js → ui-events.tsx} +107 -25
- package/src/{index.js → index.tsx} +2 -0
- package/src/scripts/{generate-crop-table.js → generate-crop-table.ts} +5 -4
- package/src/services/{cellar.test.js → cellar.test.ts} +1 -1
- package/src/services/{wine.js → wine.ts} +1 -0
- package/src/shell/{notifications.test.js → notifications.test.ts} +19 -13
- package/src/{templates.js → templates.ts} +8 -0
- package/src/test-utils/{index.js → index.ts} +3 -3
- package/src/test-utils/stubs/{getKegStub.js → getKegStub.ts} +1 -0
- package/src/utils/{farmProductsSold.js → farmProductsSold.tsx} +2 -0
- package/src/utils/{getCropLifecycleDuration.js → getCropLifecycleDuration.ts} +1 -0
- package/src/utils/{getCropsAvailableToFerment.js → getCropsAvailableToFerment.ts} +1 -0
- package/src/utils/{getInventoryQuantityMap.js → getInventoryQuantityMap.ts} +1 -0
- package/src/utils/{getLevelEntitlements.js → getLevelEntitlements.ts} +4 -0
- package/src/utils/{getMaxYieldOfFermentationRecipe.js → getMaxYieldOfFermentationRecipe.ts} +1 -0
- package/src/utils/{getWineVarietiesAvailableToMake.js → getWineVarietiesAvailableToMake.ts} +2 -0
- package/src/utils/{index.test.js → index.test.ts} +0 -2
- package/src/utils/{index.js → index.tsx} +31 -18
- package/src/utils/{isItemAFarmProduct.js → isItemAFarmProduct.ts} +1 -1
- package/src/utils/{memoize.js → memoize.ts} +2 -0
- package/src/utils/{totalIngredientsInRecipe.js → totalIngredientsInRecipe.ts} +2 -0
- /package/src/common/{constants.js → constants.ts} +0 -0
- /package/src/common/services/{randomNumber.test.js → randomNumber.test.ts} +0 -0
- /package/src/common/{utils.test.js → utils.test.ts} +0 -0
- /package/src/components/AccountingView/{AccountingView.test.js → AccountingView.test.tsx} +0 -0
- /package/src/components/AccountingView/{index.js → index.ts} +0 -0
- /package/src/components/Achievement/{Achievement.test.js → Achievement.test.tsx} +0 -0
- /package/src/components/Achievement/{Achievement.js → Achievement.tsx} +0 -0
- /package/src/components/Achievement/{index.js → index.ts} +0 -0
- /package/src/components/AchievementsView/{AchievementsView.test.js → AchievementsView.test.tsx} +0 -0
- /package/src/components/AchievementsView/{index.js → index.ts} +0 -0
- /package/src/components/AnimatedNumber/{AnimatedNumber.test.js → AnimatedNumber.test.tsx} +0 -0
- /package/src/components/AnimatedNumber/{index.js → index.ts} +0 -0
- /package/src/components/AppBar/{AppBar.test.js → AppBar.test.tsx} +0 -0
- /package/src/components/AppBar/{index.js → index.ts} +0 -0
- /package/src/components/BailOutErrorBoundary/{BailOutErrorBoundary.test.js → BailOutErrorBoundary.test.tsx} +0 -0
- /package/src/components/BailOutErrorBoundary/{index.js → index.ts} +0 -0
- /package/src/components/Cellar/{Cellar.js → Cellar.tsx} +0 -0
- /package/src/components/Cellar/{FermentationTabPanel.js → FermentationTabPanel.tsx} +0 -0
- /package/src/components/Cellar/TabPanel/{index.js → index.tsx} +0 -0
- /package/src/components/Cellar/{WinemakingTabPanel.js → WinemakingTabPanel.tsx} +0 -0
- /package/src/components/Cellar/{index.js → index.ts} +0 -0
- /package/src/components/ChatRoom/{ChatRoom.js → ChatRoom.tsx} +0 -0
- /package/src/components/ChatRoom/{index.js → index.ts} +0 -0
- /package/src/components/ContextPane/{index.js → index.ts} +0 -0
- /package/src/components/CowCard/Bloodline/{Bloodline.js → Bloodline.tsx} +0 -0
- /package/src/components/CowCard/Bloodline/{index.js → index.ts} +0 -0
- /package/src/components/CowCard/{CowCard.test.js → CowCard.test.tsx} +0 -0
- /package/src/components/CowCard/Subheader/{Subheader.test.js → Subheader.test.tsx} +0 -0
- /package/src/components/CowCard/Subheader/{index.js → index.ts} +0 -0
- /package/src/components/CowCard/{index.js → index.ts} +0 -0
- /package/src/components/CowPen/{CowPen.js → CowPen.tsx} +0 -0
- /package/src/components/CowPen/{index.js → index.ts} +0 -0
- /package/src/components/CowPenContextMenu/{CowPenContextMenu.test.js → CowPenContextMenu.test.tsx} +0 -0
- /package/src/components/CowPenContextMenu/{CowPenContextMenu.js → CowPenContextMenu.tsx} +0 -0
- /package/src/components/CowPenContextMenu/TabPanel/{index.js → index.tsx} +0 -0
- /package/src/components/CowPenContextMenu/{index.js → index.ts} +0 -0
- /package/src/components/Elements/{index.js → index.ts} +0 -0
- /package/src/components/Farmhand/{Farmhand.test.js → Farmhand.test.ts} +0 -0
- /package/src/components/Farmhand/{FarmhandReducers.js → FarmhandReducers.tsx} +0 -0
- /package/src/components/Farmhand/helpers/{getInventoryQuantities.test.js → getInventoryQuantities.test.ts} +0 -0
- /package/src/components/Farmhand/helpers/{getInventoryQuantities.js → getInventoryQuantities.ts} +0 -0
- /package/src/components/Farmhand/{index.js → index.ts} +0 -0
- /package/src/components/Field/{index.js → index.ts} +0 -0
- /package/src/components/Forest/{Forest.js → Forest.tsx} +0 -0
- /package/src/components/Forest/{index.js → index.ts} +0 -0
- /package/src/components/Home/{Home.test.js → Home.test.tsx} +0 -0
- /package/src/components/Home/{index.js → index.ts} +0 -0
- /package/src/components/IngredientsList/{IngredientsList.test.js → IngredientsList.test.tsx} +0 -0
- /package/src/components/IngredientsList/{IngredientsList.js → IngredientsList.tsx} +0 -0
- /package/src/components/IngredientsList/{index.js → index.ts} +0 -0
- /package/src/components/Inventory/{Inventory.test.js → Inventory.test.tsx} +0 -0
- /package/src/components/Inventory/{index.js → index.ts} +0 -0
- /package/src/components/Item/{Item.test.js → Item.test.tsx} +0 -0
- /package/src/components/Item/{index.js → index.ts} +0 -0
- /package/src/components/KeybindingsView/{KeybindingsView.test.js → KeybindingsView.test.tsx} +0 -0
- /package/src/components/KeybindingsView/{KeybindingsView.js → KeybindingsView.tsx} +0 -0
- /package/src/components/KeybindingsView/{index.js → index.ts} +0 -0
- /package/src/components/LogView/{LogView.test.js → LogView.test.tsx} +0 -0
- /package/src/components/LogView/{index.js → index.ts} +0 -0
- /package/src/components/Navigation/{DayAndProgressContainer.js → DayAndProgressContainer.tsx} +0 -0
- /package/src/components/Navigation/{Navigation.test.js → Navigation.test.tsx} +0 -0
- /package/src/components/Navigation/{index.js → index.ts} +0 -0
- /package/src/components/NotificationSystem/{NotificationSystem.test.js → NotificationSystem.test.tsx} +0 -0
- /package/src/components/NotificationSystem/{index.js → index.ts} +0 -0
- /package/src/components/OnlinePeersView/OnlinePeer/{OnlinePeer.test.js → OnlinePeer.test.tsx} +0 -0
- /package/src/components/OnlinePeersView/OnlinePeer/{OnlinePeer.js → OnlinePeer.tsx} +0 -0
- /package/src/components/OnlinePeersView/OnlinePeer/{index.js → index.ts} +0 -0
- /package/src/components/OnlinePeersView/{OnlinePeersView.test.js → OnlinePeersView.test.tsx} +0 -0
- /package/src/components/OnlinePeersView/{index.js → index.ts} +0 -0
- /package/src/components/Plot/{index.js → index.ts} +0 -0
- /package/src/components/PriceEventView/{PriceEventView.js → PriceEventView.tsx} +0 -0
- /package/src/components/PriceEventView/{index.js → index.ts} +0 -0
- /package/src/components/ProgressBar/{ProgressBar.test.js → ProgressBar.test.tsx} +0 -0
- /package/src/components/ProgressBar/{index.js → index.ts} +0 -0
- /package/src/components/QuantityInput/{QuantityInput.test.js → QuantityInput.test.tsx} +0 -0
- /package/src/components/QuantityInput/{index.js → index.ts} +0 -0
- /package/src/components/QuickSelect/{QuickSelect.test.js → QuickSelect.test.tsx} +0 -0
- /package/src/components/QuickSelect/{QuickSelect.js → QuickSelect.tsx} +0 -0
- /package/src/components/QuickSelect/{index.js → index.ts} +0 -0
- /package/src/components/Recipe/{Recipe.test.js → Recipe.test.tsx} +0 -0
- /package/src/components/Recipe/{index.js → index.ts} +0 -0
- /package/src/components/RecipeList/{RecipeList.js → RecipeList.tsx} +0 -0
- /package/src/components/SearchBar/{SearchBar.test.js → SearchBar.test.tsx} +0 -0
- /package/src/components/SearchBar/{SearchBar.js → SearchBar.tsx} +0 -0
- /package/src/components/SearchBar/{index.js → index.ts} +0 -0
- /package/src/components/SettingsView/{RandomSeedInput.test.js → RandomSeedInput.test.tsx} +0 -0
- /package/src/components/SettingsView/{SettingsView.test.js → SettingsView.test.tsx} +0 -0
- /package/src/components/SettingsView/{SettingsView.js → SettingsView.tsx} +0 -0
- /package/src/components/SettingsView/{index.js → index.ts} +0 -0
- /package/src/components/Shop/{Shop.test.js → Shop.test.tsx} +0 -0
- /package/src/components/Shop/TabPanel/{index.js → index.tsx} +0 -0
- /package/src/components/Shop/{index.js → index.ts} +0 -0
- /package/src/components/Stage/{index.js → index.ts} +0 -0
- /package/src/components/StatsView/{StatsView.test.js → StatsView.test.tsx} +0 -0
- /package/src/components/StatsView/{StatsView.js → StatsView.tsx} +0 -0
- /package/src/components/StatsView/{index.js → index.ts} +0 -0
- /package/src/components/TierPurchase/{TierPurchase.test.js → TierPurchase.test.tsx} +0 -0
- /package/src/components/TierPurchase/{index.js → index.ts} +0 -0
- /package/src/components/Toolbelt/{Toolbelt.test.js → Toolbelt.test.tsx} +0 -0
- /package/src/components/Toolbelt/{index.js → index.ts} +0 -0
- /package/src/components/UpdateNotifier/{UpdateNotifier.js → UpdateNotifier.tsx} +0 -0
- /package/src/components/UpdateNotifier/{index.js → index.ts} +0 -0
- /package/src/components/UpgradePurchase/{UpgradePurchase.test.js → UpgradePurchase.test.tsx} +0 -0
- /package/src/components/UpgradePurchase/{index.js → index.ts} +0 -0
- /package/src/components/Workshop/{KitchenTabPanel.js → KitchenTabPanel.tsx} +0 -0
- /package/src/components/Workshop/{RecyclingTabPanel.js → RecyclingTabPanel.tsx} +0 -0
- /package/src/components/Workshop/TabPanel/{index.js → index.tsx} +0 -0
- /package/src/components/Workshop/{Workshop.js → Workshop.tsx} +0 -0
- /package/src/components/Workshop/{index.js → index.ts} +0 -0
- /package/src/{config.js → config.ts} +0 -0
- /package/src/data/__mocks__/{items.js → items.ts} +0 -0
- /package/src/data/__mocks__/{maps.js → maps.ts} +0 -0
- /package/src/data/__mocks__/{recipes.js → recipes.ts} +0 -0
- /package/src/data/__mocks__/{shop-inventory.js → shop-inventory.ts} +0 -0
- /package/src/data/crops/{index.js → index.ts} +0 -0
- /package/src/data/{fruit-names.js → fruit-names.ts} +0 -0
- /package/src/data/{items-map.js → items-map.ts} +0 -0
- /package/src/data/ores/{index.js → index.ts} +0 -0
- /package/src/data/{shop-inventory-cow.js → shop-inventory-cow.ts} +0 -0
- /package/src/data/{shop-inventory.js → shop-inventory.ts} +0 -0
- /package/src/data/{tools.js → tools.ts} +0 -0
- /package/src/factories/{CoalFactory.test.js → CoalFactory.test.ts} +0 -0
- /package/src/factories/{OreFactory.test.js → OreFactory.test.ts} +0 -0
- /package/src/factories/{StoneFactory.test.js → StoneFactory.test.ts} +0 -0
- /package/src/factories/{index.js → index.ts} +0 -0
- /package/src/game-logic/cows/{cow-selection.test.js → cow-selection.test.ts} +0 -0
- /package/src/game-logic/{item-purchase.test.js → item-purchase.test.ts} +0 -0
- /package/src/game-logic/{item-sell.test.js → item-sell.test.ts} +0 -0
- /package/src/game-logic/reducers/{addCowToInventory.js → addCowToInventory.ts} +0 -0
- /package/src/game-logic/reducers/{addExperience.test.js → addExperience.test.ts} +0 -0
- /package/src/game-logic/reducers/{addExperience.js → addExperience.ts} +0 -0
- /package/src/game-logic/reducers/{addItemToInventory.test.js → addItemToInventory.test.ts} +0 -0
- /package/src/game-logic/reducers/{addItemToInventory.js → addItemToInventory.ts} +0 -0
- /package/src/game-logic/reducers/{addKegToCellarInventory.js → addKegToCellarInventory.ts} +0 -0
- /package/src/game-logic/reducers/{addPeer.js → addPeer.ts} +0 -0
- /package/src/game-logic/reducers/{addRevenue.js → addRevenue.ts} +0 -0
- /package/src/game-logic/reducers/{adjustLoan.test.js → adjustLoan.test.ts} +0 -0
- /package/src/game-logic/reducers/{adjustLoan.js → adjustLoan.ts} +0 -0
- /package/src/game-logic/reducers/{applyCrows.test.js → applyCrows.test.ts} +0 -0
- /package/src/game-logic/reducers/{applyLoanInterest.test.js → applyLoanInterest.test.ts} +0 -0
- /package/src/game-logic/reducers/{applyPrecipitation.test.js → applyPrecipitation.test.ts} +0 -0
- /package/src/game-logic/reducers/{changeCowAutomaticHugState.test.js → changeCowAutomaticHugState.test.ts} +0 -0
- /package/src/game-logic/reducers/{changeCowBreedingPenResident.test.js → changeCowBreedingPenResident.test.ts} +0 -0
- /package/src/game-logic/reducers/{changeCowBreedingPenResident.js → changeCowBreedingPenResident.ts} +0 -0
- /package/src/game-logic/reducers/{changeCowName.test.js → changeCowName.test.ts} +0 -0
- /package/src/game-logic/reducers/{changeCowName.js → changeCowName.ts} +0 -0
- /package/src/game-logic/reducers/{clearPlot.test.js → clearPlot.test.ts} +0 -0
- /package/src/game-logic/reducers/{clearPlot.js → clearPlot.ts} +0 -0
- /package/src/game-logic/reducers/{computeCowInventoryForNextDay.test.js → computeCowInventoryForNextDay.test.ts} +0 -0
- /package/src/game-logic/reducers/{computeCowInventoryForNextDay.js → computeCowInventoryForNextDay.ts} +0 -0
- /package/src/game-logic/reducers/{computeStateForNextDay.test.js → computeStateForNextDay.test.ts} +0 -0
- /package/src/game-logic/reducers/{consumeIngredients.test.js → consumeIngredients.test.ts} +0 -0
- /package/src/game-logic/reducers/{createPriceEvent.test.js → createPriceEvent.test.ts} +0 -0
- /package/src/game-logic/reducers/{createPriceEvent.js → createPriceEvent.ts} +0 -0
- /package/src/game-logic/reducers/{decrementItemFromInventory.test.js → decrementItemFromInventory.test.ts} +0 -0
- /package/src/game-logic/reducers/{decrementItemFromInventory.js → decrementItemFromInventory.ts} +0 -0
- /package/src/game-logic/reducers/{fertilizePlot.test.js → fertilizePlot.test.ts} +0 -0
- /package/src/game-logic/reducers/{fertilizePlot.js → fertilizePlot.ts} +0 -0
- /package/src/game-logic/reducers/{forRange.test.js → forRange.test.ts} +0 -0
- /package/src/game-logic/reducers/{forRange.js → forRange.ts} +0 -0
- /package/src/game-logic/reducers/{generatePriceEvents.test.js → generatePriceEvents.test.ts} +0 -0
- /package/src/game-logic/reducers/{generatePriceEvents.js → generatePriceEvents.ts} +0 -0
- /package/src/game-logic/reducers/{harvestPlot.test.js → harvestPlot.test.ts} +0 -0
- /package/src/game-logic/reducers/{helpers.js → helpers.tsx} +0 -0
- /package/src/game-logic/reducers/{hugCow.test.js → hugCow.test.ts} +0 -0
- /package/src/game-logic/reducers/{hugCow.js → hugCow.ts} +0 -0
- /package/src/game-logic/reducers/{incrementPlotContentAge.test.js → incrementPlotContentAge.test.ts} +0 -0
- /package/src/game-logic/reducers/{incrementPlotContentAge.js → incrementPlotContentAge.ts} +0 -0
- /package/src/game-logic/reducers/{index.js → index.ts} +0 -0
- /package/src/game-logic/reducers/{makeFermentationRecipe.test.js → makeFermentationRecipe.test.ts} +0 -0
- /package/src/game-logic/reducers/{makeRecipe.js → makeRecipe.ts} +0 -0
- /package/src/game-logic/reducers/{minePlot.test.js → minePlot.test.ts} +0 -0
- /package/src/game-logic/reducers/{modifyCow.js → modifyCow.ts} +0 -0
- /package/src/game-logic/reducers/{modifyFieldPlotAt.js → modifyFieldPlotAt.ts} +0 -0
- /package/src/game-logic/reducers/{offerCow.test.js → offerCow.test.ts} +0 -0
- /package/src/game-logic/reducers/{offerCow.js → offerCow.ts} +0 -0
- /package/src/game-logic/reducers/{plantInPlot.test.js → plantInPlot.test.ts} +0 -0
- /package/src/game-logic/reducers/{plantInPlot.js → plantInPlot.ts} +0 -0
- /package/src/game-logic/reducers/{prependPendingPeerMessage.test.js → prependPendingPeerMessage.test.ts} +0 -0
- /package/src/game-logic/reducers/{prependPendingPeerMessage.js → prependPendingPeerMessage.ts} +0 -0
- /package/src/game-logic/reducers/{processCellar.test.js → processCellar.test.ts} +0 -0
- /package/src/game-logic/reducers/{processCellar.js → processCellar.ts} +0 -0
- /package/src/game-logic/reducers/{processCowAttrition.test.js → processCowAttrition.test.ts} +0 -0
- /package/src/game-logic/reducers/{processCowAttrition.js → processCowAttrition.ts} +0 -0
- /package/src/game-logic/reducers/{processCowBreeding.test.js → processCowBreeding.test.ts} +0 -0
- /package/src/game-logic/reducers/{processCowBreeding.js → processCowBreeding.ts} +0 -0
- /package/src/game-logic/reducers/{processCowFertilizerProduction.test.js → processCowFertilizerProduction.test.ts} +0 -0
- /package/src/game-logic/reducers/{processFeedingCows.test.js → processFeedingCows.test.ts} +0 -0
- /package/src/game-logic/reducers/{processFeedingCows.js → processFeedingCows.ts} +0 -0
- /package/src/game-logic/reducers/{processField.js → processField.ts} +0 -0
- /package/src/game-logic/reducers/{processLevelUp.test.js → processLevelUp.test.ts} +0 -0
- /package/src/game-logic/reducers/{processMilkingCows.test.js → processMilkingCows.test.ts} +0 -0
- /package/src/game-logic/reducers/{processMilkingCows.js → processMilkingCows.ts} +0 -0
- /package/src/game-logic/reducers/{processNerfs.test.js → processNerfs.test.ts} +0 -0
- /package/src/game-logic/reducers/{processNerfs.js → processNerfs.ts} +0 -0
- /package/src/game-logic/reducers/{processSprinklers.test.js → processSprinklers.test.ts} +0 -0
- /package/src/game-logic/reducers/{processSprinklers.js → processSprinklers.ts} +0 -0
- /package/src/game-logic/reducers/{processWeather.test.js → processWeather.test.ts} +0 -0
- /package/src/game-logic/reducers/{processWeather.js → processWeather.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseCellar.test.js → purchaseCellar.test.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseCellar.js → purchaseCellar.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseCombine.test.js → purchaseCombine.test.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseCombine.js → purchaseCombine.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseComposter.test.js → purchaseComposter.test.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseComposter.js → purchaseComposter.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseCow.test.js → purchaseCow.test.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseCow.js → purchaseCow.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseCowPen.test.js → purchaseCowPen.test.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseCowPen.js → purchaseCowPen.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseItem.test.js → purchaseItem.test.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseItem.js → purchaseItem.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseSmelter.test.js → purchaseSmelter.test.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseSmelter.js → purchaseSmelter.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseStorageExpansion.test.js → purchaseStorageExpansion.test.ts} +0 -0
- /package/src/game-logic/reducers/{purchaseStorageExpansion.js → purchaseStorageExpansion.ts} +0 -0
- /package/src/game-logic/reducers/{removeCowFromInventory.js → removeCowFromInventory.ts} +0 -0
- /package/src/game-logic/reducers/{removeFieldPlotAt.js → removeFieldPlotAt.ts} +0 -0
- /package/src/game-logic/reducers/{removeKegFromCellar.js → removeKegFromCellar.ts} +0 -0
- /package/src/game-logic/reducers/{removePeer.js → removePeer.ts} +0 -0
- /package/src/game-logic/reducers/{rotateNotificationLogs.test.js → rotateNotificationLogs.test.ts} +0 -0
- /package/src/game-logic/reducers/{selectCow.test.js → selectCow.test.ts} +0 -0
- /package/src/game-logic/reducers/{selectCow.js → selectCow.ts} +0 -0
- /package/src/game-logic/reducers/{sellCow.js → sellCow.ts} +0 -0
- /package/src/game-logic/reducers/{sellItem.js → sellItem.ts} +0 -0
- /package/src/game-logic/reducers/{sellKeg.test.js → sellKeg.test.ts} +0 -0
- /package/src/game-logic/reducers/{setScarecrow.test.js → setScarecrow.test.ts} +0 -0
- /package/src/game-logic/reducers/{setScarecrow.js → setScarecrow.ts} +0 -0
- /package/src/game-logic/reducers/{setSprinkler.test.js → setSprinkler.test.ts} +0 -0
- /package/src/game-logic/reducers/{setSprinkler.js → setSprinkler.ts} +0 -0
- /package/src/game-logic/reducers/{showNotification.test.js → showNotification.test.ts} +0 -0
- /package/src/game-logic/reducers/{showNotification.js → showNotification.ts} +0 -0
- /package/src/game-logic/reducers/{spawnWeeds.test.js → spawnWeeds.test.ts} +0 -0
- /package/src/game-logic/reducers/{unlockTool.test.js → unlockTool.test.ts} +0 -0
- /package/src/game-logic/reducers/{unlockTool.js → unlockTool.ts} +0 -0
- /package/src/game-logic/reducers/{updateAchievements.test.js → updateAchievements.test.ts} +0 -0
- /package/src/game-logic/reducers/{updateFinancialRecords.test.js → updateFinancialRecords.test.ts} +0 -0
- /package/src/game-logic/reducers/{updateFinancialRecords.js → updateFinancialRecords.ts} +0 -0
- /package/src/game-logic/reducers/{updateInventoryRecordsForNextDay.test.js → updateInventoryRecordsForNextDay.test.ts} +0 -0
- /package/src/game-logic/reducers/{updateInventoryRecordsForNextDay.js → updateInventoryRecordsForNextDay.ts} +0 -0
- /package/src/game-logic/reducers/{updateLearnedRecipes.test.js → updateLearnedRecipes.test.ts} +0 -0
- /package/src/game-logic/reducers/{updateLearnedRecipes.js → updateLearnedRecipes.ts} +0 -0
- /package/src/game-logic/reducers/{updatePlotShoveledState.js → updatePlotShoveledState.ts} +0 -0
- /package/src/game-logic/reducers/{updatePriceEvents.test.js → updatePriceEvents.test.ts} +0 -0
- /package/src/game-logic/reducers/{updatePriceEvents.js → updatePriceEvents.tsx} +0 -0
- /package/src/game-logic/reducers/{upgradeTool.test.js → upgradeTool.test.ts} +0 -0
- /package/src/game-logic/reducers/{upgradeTool.js → upgradeTool.ts} +0 -0
- /package/src/game-logic/reducers/{waterAllPlots.test.js → waterAllPlots.test.ts} +0 -0
- /package/src/game-logic/reducers/{waterAllPlots.js → waterAllPlots.ts} +0 -0
- /package/src/game-logic/reducers/{waterField.js → waterField.ts} +0 -0
- /package/src/game-logic/reducers/{waterPlot.test.js → waterPlot.test.ts} +0 -0
- /package/src/game-logic/reducers/{waterPlot.js → waterPlot.ts} +0 -0
- /package/src/game-logic/reducers/{withdrawCow.test.js → withdrawCow.test.ts} +0 -0
- /package/src/game-logic/reducers/{withdrawCow.js → withdrawCow.ts} +0 -0
- /package/src/img/__mocks__/{index.js → index.ts} +0 -0
- /package/src/img/{index.js → index.ts} +0 -0
- /package/src/interfaces/{Factory.js → Factory.ts} +0 -0
- /package/src/{mui-theme.js → mui-theme.ts} +0 -0
- /package/src/{polyfills.js → polyfills.ts} +0 -0
- /package/src/services/{cellar.js → cellar.ts} +0 -0
- /package/src/services/{wine.test.js → wine.test.ts} +0 -0
- /package/src/{setupTests.js → setupTests.ts} +0 -0
- /package/src/shell/{bootup.test.js → bootup.test.ts} +0 -0
- /package/src/shell/{field.test.js → field.test.ts} +0 -0
- /package/src/shell/{game-saving.test.js → game-saving.test.ts} +0 -0
- /package/src/shell/{navigation.test.js → navigation.test.ts} +0 -0
- /package/src/shell/{pending-notifications.test.js → pending-notifications.test.ts} +0 -0
- /package/src/{strings.js → strings.ts} +0 -0
- /package/src/test-utils/stubs/{cowStub.js → cowStub.ts} +0 -0
- /package/src/test-utils/stubs/{farmhandStub.js → farmhandStub.tsx} +0 -0
- /package/src/test-utils/stubs/{itemStub.js → itemStub.ts} +0 -0
- /package/src/test-utils/stubs/{peerMetadataStub.js → peerMetadataStub.ts} +0 -0
- /package/src/test-utils/stubs/{saveDataStubFactory.js → saveDataStubFactory.ts} +0 -0
- /package/src/test-utils/{ui.js → ui.ts} +0 -0
- /package/src/utils/__snapshots__/{index.test.js.snap → index.test.ts.snap} +0 -0
- /package/src/utils/{findInField.test.js → findInField.test.ts} +0 -0
- /package/src/utils/{findInField.js → findInField.ts} +0 -0
- /package/src/utils/{getCropLifecycleDuration.test.js → getCropLifecycleDuration.test.ts} +0 -0
- /package/src/utils/{getCropsAvailableToFerment.test.js → getCropsAvailableToFerment.test.ts} +0 -0
- /package/src/utils/{getItemBaseValue.js → getItemBaseValue.ts} +0 -0
- /package/src/utils/{getKegSpoilageRate.test.js → getKegSpoilageRate.test.ts} +0 -0
- /package/src/utils/{getKegSpoilageRate.js → getKegSpoilageRate.ts} +0 -0
- /package/src/utils/{getKegValue.test.js → getKegValue.test.ts} +0 -0
- /package/src/utils/{getKegValue.js → getKegValue.ts} +0 -0
- /package/src/utils/{getLevelEntitlements.test.js → getLevelEntitlements.test.ts} +0 -0
- /package/src/utils/{getMaxYieldOfFermentationRecipe.test.js → getMaxYieldOfFermentationRecipe.test.ts} +0 -0
- /package/src/utils/{getSaltRequirementsForFermentationRecipe.js → getSaltRequirementsForFermentationRecipe.ts} +0 -0
- /package/src/utils/{getWineVarietiesAvailableToMake.test.js → getWineVarietiesAvailableToMake.test.ts} +0 -0
- /package/src/utils/{getYeastRequiredForWine.js → getYeastRequiredForWine.ts} +0 -0
- /package/src/utils/{isItemAGrownCrop.js → isItemAGrownCrop.ts} +0 -0
- /package/src/utils/{levelAchieved.js → levelAchieved.ts} +0 -0
- /package/src/utils/{moneyString.test.js → moneyString.test.ts} +0 -0
- /package/src/utils/{moneyString.js → moneyString.ts} +0 -0
- /package/src/utils/{noop.js → noop.ts} +0 -0
- /package/src/utils/{totalIngredientsInRecipe.test.js → totalIngredientsInRecipe.test.ts} +0 -0
|
@@ -200,6 +200,7 @@ export const LEVEL_GAINED_NOTIFICATION = (_, newLevel, randomCropSeed) => {
|
|
|
200
200
|
itemsMap[itemUnlockLevels[newLevel]].name
|
|
201
201
|
}**.`
|
|
202
202
|
)
|
|
203
|
+
// @ts-expect-error
|
|
203
204
|
} else if (levelObject && levelObject.increasesSprinklerRange) {
|
|
204
205
|
chunks.push(`Sprinkler range has increased.`)
|
|
205
206
|
} else if (randomCropSeed) {
|
|
@@ -208,11 +209,15 @@ export const LEVEL_GAINED_NOTIFICATION = (_, newLevel, randomCropSeed) => {
|
|
|
208
209
|
randomCropSeed.name
|
|
209
210
|
}** as a reward!`
|
|
210
211
|
)
|
|
212
|
+
// @ts-expect-error
|
|
211
213
|
} else if (levelObject && levelObject.unlocksTool) {
|
|
214
|
+
// @ts-expect-error
|
|
212
215
|
if (levelObject.unlocksTool === toolType.SHOVEL) {
|
|
213
216
|
chunks.push(SHOVEL_UNLOCKED)
|
|
214
217
|
}
|
|
218
|
+
// @ts-expect-error
|
|
215
219
|
} else if (levelObject && levelObject.unlocksStageFocusType) {
|
|
220
|
+
// @ts-expect-error
|
|
216
221
|
if (levelObject.unlocksStageFocusType === stageFocusType.FOREST) {
|
|
217
222
|
chunks.push(FOREST_AVAILABLE_NOTIFICATION)
|
|
218
223
|
}
|
|
@@ -240,6 +245,7 @@ export const POSITIONS_POSTED_NOTIFICATION = (_, who, positions) => {
|
|
|
240
245
|
const positionKeys = Object.keys(positions)
|
|
241
246
|
|
|
242
247
|
positionKeys.forEach(itemId =>
|
|
248
|
+
// @ts-expect-error
|
|
243
249
|
(positions[itemId] > 0 ? positivePositions : negativePositions).push(itemId)
|
|
244
250
|
)
|
|
245
251
|
|
|
@@ -248,6 +254,7 @@ export const POSITIONS_POSTED_NOTIFICATION = (_, who, positions) => {
|
|
|
248
254
|
if (positivePositions.length) {
|
|
249
255
|
chunks.push('Values raised:')
|
|
250
256
|
positivePositions.forEach(itemId =>
|
|
257
|
+
// @ts-expect-error
|
|
251
258
|
chunks.push(` - ${itemsMap[itemId].name}`)
|
|
252
259
|
)
|
|
253
260
|
}
|
|
@@ -259,6 +266,7 @@ export const POSITIONS_POSTED_NOTIFICATION = (_, who, positions) => {
|
|
|
259
266
|
|
|
260
267
|
chunks.push('Values lowered:')
|
|
261
268
|
negativePositions.forEach(itemId =>
|
|
269
|
+
// @ts-expect-error
|
|
262
270
|
chunks.push(` - ${itemsMap[itemId].name}`)
|
|
263
271
|
)
|
|
264
272
|
}
|
|
@@ -40,7 +40,7 @@ export const testShoveledPlot = plotProps => ({
|
|
|
40
40
|
export const testItem = (item = {}) => ({
|
|
41
41
|
id: '',
|
|
42
42
|
name: '',
|
|
43
|
-
type: /** @type {farmhand.itemType} */
|
|
43
|
+
type: /** @type {farmhand.itemType} */ 'CRAFTED_ITEM',
|
|
44
44
|
value: 0,
|
|
45
45
|
description: '',
|
|
46
46
|
doesPriceFluctuate: false,
|
|
@@ -62,8 +62,8 @@ export const testRecipe = (overrides = {}) => ({
|
|
|
62
62
|
'sample-item-1': 1,
|
|
63
63
|
},
|
|
64
64
|
condition: () => true,
|
|
65
|
-
recipeType: /** @type {farmhand.recipeType} */
|
|
66
|
-
type: /** @type {farmhand.itemType} */
|
|
65
|
+
recipeType: /** @type {farmhand.recipeType} */ 'KITCHEN',
|
|
66
|
+
type: /** @type {farmhand.itemType} */ 'CRAFTED_ITEM',
|
|
67
67
|
value: 100,
|
|
68
68
|
...overrides,
|
|
69
69
|
})
|
|
@@ -3,6 +3,7 @@ import { itemsMap } from '../data/maps.js'
|
|
|
3
3
|
import { memoize } from './memoize.js'
|
|
4
4
|
import { isItemAFarmProduct } from './isItemAFarmProduct.js'
|
|
5
5
|
|
|
6
|
+
// @ts-expect-error
|
|
6
7
|
export const farmProductsSold = memoize(
|
|
7
8
|
/**
|
|
8
9
|
* @param {Partial<Record<string, number>>} itemsSold
|
|
@@ -11,6 +12,7 @@ export const farmProductsSold = memoize(
|
|
|
11
12
|
itemsSold =>
|
|
12
13
|
Object.entries(itemsSold).reduce(
|
|
13
14
|
(sum, [itemId, numberSold]) =>
|
|
15
|
+
// @ts-expect-error
|
|
14
16
|
sum + (isItemAFarmProduct(itemsMap[itemId]) ? numberSold || 0 : 0),
|
|
15
17
|
0
|
|
16
18
|
)
|
|
@@ -4,6 +4,7 @@ import { memoize } from './memoize.js'
|
|
|
4
4
|
* @param {{ cropTimeline: number[] }} crop
|
|
5
5
|
* @returns {number}
|
|
6
6
|
*/
|
|
7
|
+
// @ts-expect-error
|
|
7
8
|
export const getCropLifecycleDuration = memoize(({ cropTimeline }) => {
|
|
8
9
|
return cropTimeline.reduce((acc, value) => {
|
|
9
10
|
return acc + value
|
|
@@ -9,6 +9,7 @@ import { memoize } from './memoize.js'
|
|
|
9
9
|
* @returns {levelEntitlements} Contains `sprinklerRange` and keys that correspond to
|
|
10
10
|
* unlocked items.
|
|
11
11
|
*/
|
|
12
|
+
// @ts-expect-error
|
|
12
13
|
export const getLevelEntitlements = memoize(
|
|
13
14
|
/**
|
|
14
15
|
* @param {number} levelNumber
|
|
@@ -37,14 +38,17 @@ export const getLevelEntitlements = memoize(
|
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
if (unlocksShopItem) {
|
|
41
|
+
// @ts-expect-error
|
|
40
42
|
acc.items[unlocksShopItem] = true
|
|
41
43
|
}
|
|
42
44
|
|
|
43
45
|
if (unlocksTool) {
|
|
46
|
+
// @ts-expect-error
|
|
44
47
|
acc.tools[unlocksTool] = true
|
|
45
48
|
}
|
|
46
49
|
|
|
47
50
|
if (unlocksStageFocusType) {
|
|
51
|
+
// @ts-expect-error
|
|
48
52
|
acc.stageFocusType[unlocksStageFocusType] = true
|
|
49
53
|
}
|
|
50
54
|
|
|
@@ -729,7 +729,6 @@ describe('canMakeRecipe', () => {
|
|
|
729
729
|
test('evaluates inventory correctly', () => {
|
|
730
730
|
expect(
|
|
731
731
|
canMakeRecipe(
|
|
732
|
-
// @ts-expect-error
|
|
733
732
|
{ ingredients: { 'sample-item-1': 2 } },
|
|
734
733
|
[{ id: 'sample-item-1', quantity: 1 }],
|
|
735
734
|
1
|
|
@@ -742,7 +741,6 @@ describe('canMakeRecipe', () => {
|
|
|
742
741
|
test('evaluates inventory correctly', () => {
|
|
743
742
|
expect(
|
|
744
743
|
canMakeRecipe(
|
|
745
|
-
// @ts-expect-error
|
|
746
744
|
{ ingredients: { 'sample-item-1': 2 } },
|
|
747
745
|
[{ id: 'sample-item-1', quantity: 2 }],
|
|
748
746
|
1
|
|
@@ -289,6 +289,7 @@ export const getPlotContentType = ({ itemId }) =>
|
|
|
289
289
|
export const doesPlotContainCrop = plot =>
|
|
290
290
|
plot !== null && getPlotContentType(plot) === itemType.CROP
|
|
291
291
|
|
|
292
|
+
// @ts-expect-error
|
|
292
293
|
export const getLifeStageRange = memoize((
|
|
293
294
|
/** @type {number[]} */ cropTimeline
|
|
294
295
|
) => {
|
|
@@ -330,7 +331,9 @@ export const getGrowingPhase = memoize(
|
|
|
330
331
|
},
|
|
331
332
|
{
|
|
332
333
|
cacheSize:
|
|
334
|
+
// @ts-expect-error
|
|
333
335
|
LARGEST_PURCHASABLE_FIELD_SIZE.columns *
|
|
336
|
+
// @ts-expect-error
|
|
334
337
|
LARGEST_PURCHASABLE_FIELD_SIZE.rows,
|
|
335
338
|
}
|
|
336
339
|
)
|
|
@@ -386,7 +389,7 @@ export const getPlotImage = (plotContents, x, y) => {
|
|
|
386
389
|
}
|
|
387
390
|
|
|
388
391
|
// Handle other plot content (non-crop, non-weed)
|
|
389
|
-
return itemImages[/** @type {farmhand.plotContent} */
|
|
392
|
+
return itemImages[/** @type {farmhand.plotContent} */ plotContents.itemId]
|
|
390
393
|
}
|
|
391
394
|
|
|
392
395
|
if (isShoveledPlot(plotContents)) {
|
|
@@ -409,13 +412,12 @@ export const getRangeCoords = (rangeSize, centerX, centerY) => {
|
|
|
409
412
|
const rangeStartX = centerX - rangeSize
|
|
410
413
|
const rangeStartY = centerY - rangeSize
|
|
411
414
|
|
|
412
|
-
return new Array(squareSize)
|
|
413
|
-
.fill(null)
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
)
|
|
415
|
+
return new Array(squareSize).fill(null).map((_, yIndex) =>
|
|
416
|
+
new Array(squareSize).fill(null).map((__, xIndex) => ({
|
|
417
|
+
x: rangeStartX + xIndex,
|
|
418
|
+
y: rangeStartY + yIndex,
|
|
419
|
+
}))
|
|
420
|
+
)
|
|
419
421
|
}
|
|
420
422
|
|
|
421
423
|
/**
|
|
@@ -449,12 +451,14 @@ export const getFinalCropItemIdFromSeedItemId = (
|
|
|
449
451
|
|
|
450
452
|
export const getSeedItemIdFromFinalStageCropItemId = memoize(
|
|
451
453
|
/** @type {string} */ cropItemId => {
|
|
454
|
+
// @ts-expect-error
|
|
452
455
|
const seedItemId = Object.values(itemsMap).find(({ growsInto }) => {
|
|
453
456
|
if (Array.isArray(growsInto)) {
|
|
454
457
|
return growsInto.includes(cropItemId)
|
|
455
458
|
} else {
|
|
456
459
|
return growsInto === cropItemId
|
|
457
460
|
}
|
|
461
|
+
// @ts-expect-error
|
|
458
462
|
})?.id
|
|
459
463
|
|
|
460
464
|
if (!seedItemId)
|
|
@@ -494,8 +498,11 @@ export const getCowDisplayName = (cow, playerId, allowCustomPeerCowNames) => {
|
|
|
494
498
|
* @returns {farmhand.cow}
|
|
495
499
|
*/
|
|
496
500
|
export const generateCow = (options = {}) => {
|
|
501
|
+
// @ts-expect-error
|
|
497
502
|
const gender = options.gender || chooseRandom(Object.values(genders))
|
|
503
|
+
// @ts-expect-error
|
|
498
504
|
const color = options.color || chooseRandom(Object.values(standardCowColors))
|
|
505
|
+
// @ts-expect-error
|
|
499
506
|
const id = options.id || uuid()
|
|
500
507
|
|
|
501
508
|
const baseWeight = Math.round(
|
|
@@ -560,7 +567,7 @@ export const generateOffspringCow = (cow1, cow2, ownerId, customProps = {}) => {
|
|
|
560
567
|
}
|
|
561
568
|
|
|
562
569
|
delete colorsInBloodline[
|
|
563
|
-
/** @type {keyof typeof colorsInBloodline} */
|
|
570
|
+
/** @type {keyof typeof colorsInBloodline} */ cowColors.RAINBOW
|
|
564
571
|
]
|
|
565
572
|
|
|
566
573
|
const isRainbowCow =
|
|
@@ -675,6 +682,7 @@ export const getCowSellValue = cow => getCowValue(cow, true)
|
|
|
675
682
|
* @param {{id: string, quantity: number}[]} inventory
|
|
676
683
|
* @returns {number}
|
|
677
684
|
*/
|
|
685
|
+
// @ts-expect-error
|
|
678
686
|
export const maxYieldOfRecipe = memoize(({ ingredients }, inventory) => {
|
|
679
687
|
const inventoryQuantityMap = getInventoryQuantityMap(inventory)
|
|
680
688
|
|
|
@@ -742,6 +750,7 @@ export const doesMenuObstructStage = () => window.innerWidth < BREAKPOINTS.MD
|
|
|
742
750
|
/** @type {Set<farmhand.itemType>} */
|
|
743
751
|
const itemTypesToShowInReverse = new Set([itemType.MILK])
|
|
744
752
|
|
|
753
|
+
// @ts-expect-error
|
|
745
754
|
const sortItemIdsByTypeAndValue = memoize(itemIds =>
|
|
746
755
|
sortBy(itemIds, [
|
|
747
756
|
id => Number(itemsMap[id].type !== itemType.CROP),
|
|
@@ -763,6 +772,7 @@ export const sortItems = items => {
|
|
|
763
772
|
return sortItemIdsByTypeAndValue(items.map(({ id }) => id)).map(id => map[id])
|
|
764
773
|
}
|
|
765
774
|
|
|
775
|
+
// @ts-expect-error
|
|
766
776
|
export const inventorySpaceConsumed = memoize(
|
|
767
777
|
/**
|
|
768
778
|
* @param {farmhand.state['inventory']} inventory
|
|
@@ -787,6 +797,7 @@ export const inventorySpaceRemaining = ({ inventory, inventoryLimit }) =>
|
|
|
787
797
|
export const doesInventorySpaceRemain = state =>
|
|
788
798
|
inventorySpaceRemaining(state) > 0
|
|
789
799
|
|
|
800
|
+
// @ts-expect-error
|
|
790
801
|
export const areHuggingMachinesInInventory = memoize(
|
|
791
802
|
/**
|
|
792
803
|
* @param {farmhand.state['inventory']} inventory
|
|
@@ -806,6 +817,7 @@ export const nullArray = memoize(
|
|
|
806
817
|
}
|
|
807
818
|
)
|
|
808
819
|
|
|
820
|
+
// @ts-expect-error
|
|
809
821
|
export const findCowById = memoize(
|
|
810
822
|
/**
|
|
811
823
|
* @param {Array.<farmhand.cow>} cowInventory
|
|
@@ -822,6 +834,7 @@ export const findCowById = memoize(
|
|
|
822
834
|
export const experienceNeededForLevel = targetLevel =>
|
|
823
835
|
((targetLevel - 1) * 10) ** 2
|
|
824
836
|
|
|
837
|
+
// @ts-expect-error
|
|
825
838
|
export const getAvailableShopInventory = memoize((
|
|
826
839
|
/** @type {farmhand.levelEntitlements} */ levelEntitlements
|
|
827
840
|
) =>
|
|
@@ -866,7 +879,7 @@ export const getPeerMetadata = state => {
|
|
|
866
879
|
|
|
867
880
|
return acc
|
|
868
881
|
},
|
|
869
|
-
/** @type {Partial<farmhand.peerMetadata>} */
|
|
882
|
+
/** @type {Partial<farmhand.peerMetadata>} */ {}
|
|
870
883
|
)
|
|
871
884
|
|
|
872
885
|
Object.assign(reducedState, {
|
|
@@ -875,7 +888,7 @@ export const getPeerMetadata = state => {
|
|
|
875
888
|
),
|
|
876
889
|
})
|
|
877
890
|
|
|
878
|
-
return /** @type {farmhand.peerMetadata} */
|
|
891
|
+
return /** @type {farmhand.peerMetadata} */ reducedState
|
|
879
892
|
}
|
|
880
893
|
|
|
881
894
|
/**
|
|
@@ -884,7 +897,7 @@ export const getPeerMetadata = state => {
|
|
|
884
897
|
* farmhand.state data that should be persisted.
|
|
885
898
|
*/
|
|
886
899
|
export const reduceByPersistedKeys = state =>
|
|
887
|
-
/** @type {farmhand.state} */
|
|
900
|
+
/** @type {farmhand.state} */ PERSISTED_STATE_KEYS.reduce((
|
|
888
901
|
/** @type {Partial<farmhand.state>} */ acc,
|
|
889
902
|
key
|
|
890
903
|
) => {
|
|
@@ -895,7 +908,7 @@ export const reduceByPersistedKeys = state =>
|
|
|
895
908
|
}
|
|
896
909
|
|
|
897
910
|
return acc
|
|
898
|
-
}, {})
|
|
911
|
+
}, {})
|
|
899
912
|
|
|
900
913
|
/**
|
|
901
914
|
* @param {Array.<number>} historicalData Must be no longer than 7 numbers long.
|
|
@@ -993,8 +1006,7 @@ export const transformStateDataForImport = /** @type {(state: any) => farmhand.s
|
|
|
993
1006
|
) {
|
|
994
1007
|
sanitizedState = {
|
|
995
1008
|
...sanitizedState,
|
|
996
|
-
stageFocus:
|
|
997
|
-
/** @type {farmhand.stageFocusType} */ (STANDARD_VIEW_LIST[0]),
|
|
1009
|
+
stageFocus: /** @type {farmhand.stageFocusType} */ STANDARD_VIEW_LIST[0],
|
|
998
1010
|
}
|
|
999
1011
|
}
|
|
1000
1012
|
|
|
@@ -1036,17 +1048,15 @@ export const transformStateDataForImport = /** @type {(state: any) => farmhand.s
|
|
|
1036
1048
|
}
|
|
1037
1049
|
|
|
1038
1050
|
// NOTE: Legacy data trasformation for https://github.com/jeremyckahn/farmhand/issues/387
|
|
1039
|
-
// @ts-expect-error
|
|
1040
1051
|
if (sanitizedState.id) {
|
|
1041
|
-
// @ts-expect-error
|
|
1042
1052
|
sanitizedState.playerId = sanitizedState.id
|
|
1043
|
-
// @ts-expect-error
|
|
1044
1053
|
delete sanitizedState.id
|
|
1045
1054
|
}
|
|
1046
1055
|
|
|
1047
1056
|
return sanitizedState
|
|
1048
1057
|
}
|
|
1049
1058
|
|
|
1059
|
+
// @ts-expect-error
|
|
1050
1060
|
export const getPlayerName = memoize(
|
|
1051
1061
|
/**
|
|
1052
1062
|
* @param {string} playerId
|
|
@@ -1114,9 +1124,11 @@ export function randomChoice(weightedOptions) {
|
|
|
1114
1124
|
|
|
1115
1125
|
for (let option of weightedOptions) {
|
|
1116
1126
|
totalWeight += option.weight
|
|
1127
|
+
// @ts-expect-error
|
|
1117
1128
|
sortedOptions.push(option)
|
|
1118
1129
|
}
|
|
1119
1130
|
|
|
1131
|
+
// @ts-expect-error
|
|
1120
1132
|
sortedOptions.sort(o => o.weight)
|
|
1121
1133
|
|
|
1122
1134
|
let diceRoll = random() * totalWeight
|
|
@@ -1147,6 +1159,7 @@ const colorizeCowTemplate = (() => {
|
|
|
1147
1159
|
const cachedCowImages = {}
|
|
1148
1160
|
|
|
1149
1161
|
// https://stackoverflow.com/a/5624139
|
|
1162
|
+
// @ts-expect-error
|
|
1150
1163
|
const hexToRgb = memoize(hex => {
|
|
1151
1164
|
const [, r, g, b] = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(
|
|
1152
1165
|
hex
|
|
@@ -21,6 +21,7 @@ export class MemoizeCache {
|
|
|
21
21
|
* @see https://github.com/caiogondim/fast-memoize.js
|
|
22
22
|
*/
|
|
23
23
|
constructor({ cacheSize = MEMOIZE_CACHE_CLEAR_THRESHOLD } = {}) {
|
|
24
|
+
// @ts-expect-error
|
|
24
25
|
this.cacheSize = cacheSize
|
|
25
26
|
}
|
|
26
27
|
|
|
@@ -33,6 +34,7 @@ export class MemoizeCache {
|
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
set(key, value) {
|
|
37
|
+
// @ts-expect-error
|
|
36
38
|
if (Object.keys(this.cache).length > this.cacheSize) {
|
|
37
39
|
this.cache = {}
|
|
38
40
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/src/components/AchievementsView/{AchievementsView.test.js → AchievementsView.test.tsx}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/src/components/CowPenContextMenu/{CowPenContextMenu.test.js → CowPenContextMenu.test.tsx}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/src/components/Farmhand/helpers/{getInventoryQuantities.js → getInventoryQuantities.ts}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/src/components/IngredientsList/{IngredientsList.test.js → IngredientsList.test.tsx}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/src/components/KeybindingsView/{KeybindingsView.test.js → KeybindingsView.test.tsx}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/src/components/Navigation/{DayAndProgressContainer.js → DayAndProgressContainer.tsx}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/src/components/OnlinePeersView/OnlinePeer/{OnlinePeer.test.js → OnlinePeer.test.tsx}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/src/components/OnlinePeersView/{OnlinePeersView.test.js → OnlinePeersView.test.tsx}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|