-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* feat(#491): stand up winemaking tab * feat(#491): [wip] scaffold getWinesAvailableToMake * refactor(types): define GRAPE cropFamily * feat(#491): [wip] compute grapes sold * refactor(#491): use grape factory function * docs(#491): define wine type * feat(#491): define grape varieties * feat(#491): calculate wines available to make * test(#491): validate getWineVarietiesAvailableToMake * feat(#491): add wine art * feat(#491): use @lstebner's wine art * feat(#491): wire up WineRecipeList * docs: improve types for FarmhandContext * docs(types): define remaining FarmhandContext props * feat(#491): scaffold and wire up WineRecipe * feat(#491): render wine images in recipe * feat(#491): show days needed to mature wine * refactor(#491): use service for wine logic * feat(#491): show grapes required for wine * feat(#491): show number of required grapes in inventory * docs: improve context typing * docs: add types for debounced handlers * feat(#491): add flour art * feat(#491): update flour art * feat(#491): add yeast art * feat(#491): improve flour art * feat(#491): improve yeast art * feat(#491): define flour and yeast recipes * feat(#491): require yeast for wine production * feat(#491): make yeast and flour the ingredients for bread * refactor: move cellar inventory calculation to service * refactor(#491): move keg generation to CellarService * feat(#491): show wine instances in cellar * feat(#491): define getMaxWineYield * feat(#491): disable winemaking button when none can be made * refactor(#491): move doesCellarSpaceRemain to cellarService * feat(#491): accept wine quantity * feat(#491): [wip] start on wine keg creation * chore(#491): add wineId to grape type * feat(#491): define wine recipes * refactor: use better variable names * feat(#491): add wine to cellar * feat(#491): set daysUntilMature for wine * feat(#491): don't spoil wine kegs * feat(#491): implement getWineValue * feat(#491): present wine value * feat(#491): sell wine for appropriate price * feat(#491): add more info about kegs * feat(#491): use compound interest for wine value * refactor(#491): move getMaxWineYield to wineService * refactor(#491): roll wine value calculation into getKegValue * refactor: simplify getKegValue * test(#491): validate getMaxWineYield * test(#491): validate generateKeg * test: validate getKegValue * test(#491): validate makeWine * test(#491): validate presentation of days to mature for wine * refactor(makeWine): derive wine variety * test(#491): validate presentation of wine requirements * feat(#491): show available yeast * test(#491): validate presentation of current wines in cellar * test(#491): [wip] validate disabling of Make button * test(#491): [wip] validate yeast multiplier requirement presentation * feat(QuantityInput): select all text when focusing input instead of clearing it out * feat(#491): show yeast requirements for specified quantity * chore(sellItem): import types * feat(stats): sort items sold by name * feat(#491): improve cellar copy * fix(#491): use correct tab props * refactor(#491): make cropVariety type-safe * fix(#491): consume accurate amount of yeast * test(#491): validate that wine kegs do not spoil
- Loading branch information
1 parent
8731681
commit 1c061ce
Showing
61 changed files
with
1,946 additions
and
215 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import React from 'react' | ||
import { number } from 'prop-types' | ||
import Divider from '@mui/material/Divider' | ||
import Card from '@mui/material/Card' | ||
import CardContent from '@mui/material/CardContent' | ||
import ReactMarkdown from 'react-markdown' | ||
|
||
import { WineRecipeList } from '../WineRecipeList/WineRecipeList' | ||
|
||
import { TabPanel } from './TabPanel' | ||
|
||
export const WinemakingTabPanel = ({ index, currentTab }) => ( | ||
<TabPanel value={currentTab} index={index}> | ||
<WineRecipeList /> | ||
<Divider /> | ||
<ul className="card-list"> | ||
<li> | ||
<Card> | ||
<CardContent> | ||
<ReactMarkdown | ||
{...{ | ||
linkTarget: '_blank', | ||
className: 'markdown', | ||
source: | ||
'Grapes can be made into wine. Wine becomes very valuable in time and never spoils.', | ||
}} | ||
/> | ||
</CardContent> | ||
</Card> | ||
</li> | ||
</ul> | ||
</TabPanel> | ||
) | ||
|
||
WinemakingTabPanel.propTypes = { | ||
currentTab: number.isRequired, | ||
index: number.isRequired, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,35 @@ | ||
/** | ||
* @typedef {import('../../').farmhand.item} farmhand.item | ||
* @typedef {import('../../').farmhand.levelEntitlements} farmhand.levelEntitlements | ||
* @typedef {import('./Farmhand').farmhand.state} farmhand.state | ||
*/ | ||
import { createContext } from 'react' | ||
|
||
const FarmhandContext = createContext() | ||
// eslint-disable-next-line no-unused-vars | ||
import uiEventHandlers from '../../handlers/ui-events' | ||
|
||
/** | ||
* @type {import('react').Context<{ | ||
* gameState: farmhand.state & { | ||
* blockInput: boolean, | ||
* features: Record<string, boolean>, | ||
* fieldToolInventory: farmhand.item[], | ||
* isChatAvailable: boolean, | ||
* levelEntitlements: farmhand.levelEntitlements, | ||
* plantableCropInventory: farmhand.item[], | ||
* playerInventory: farmhand.item[], | ||
* playerInventoryQuantities: Record<string, number>, | ||
* shopInventory: farmhand.item[], | ||
* viewList: string[], | ||
* viewTitle: string, | ||
* } | ||
* handlers: uiEventHandlers & { debounced: uiEventHandlers } | ||
* }>} | ||
*/ | ||
// @ts-expect-error | ||
const FarmhandContext = createContext({ | ||
gameState: {}, | ||
handlers: {}, | ||
}) | ||
|
||
export default FarmhandContext |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,9 @@ body | |
|
||
@mixin markdown-styles | ||
.markdown | ||
p | ||
margin: 1em 0 | ||
|
||
ul li | ||
list-style: disc | ||
margin-left: 1em | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.