Commit graph

69 commits

Author SHA1 Message Date
1657dffcfe Feature rewrite
Some checks failed
Run Tests / test (pull_request) Failing after 1m16s
- Removed `jsx()` and `JSXFunction`. You can now use `JSX.Element` like any other `Computable` value
- `joinJSX` now always requires a joiner. Just pass the array of elements or wrap them in `<>` and `</>` if there's no joiner
- Removed `coerceComponent`, `computeComponent`, and `computeOptionalComponent`; just use the `render` function now
- It's recommended to now do `<MyComponent />` instead of `<component :is="myComponent" />`
- All features no longer take the options as a type parameter, and all generic forms have been removed as a result
- Fixed `forceHideGoBack` not being respected
- Removed `deepUnref` as now things don't get unreffed before being passed into vue components by default
- Moved MarkNode to new wrapper, and removed existing `mark` properties
- Moved Tooltip to new wrapper, and made it take an options function instead of raw object
- VueFeature component now wraps all vue features, and applies styling, classes, and visibility in the wrapping div. It also adds the Node component so features don't need to
- `mergeAdjacent` now works with grids (perhaps should've used scss to reduce the amount of css this took)
- `CoercableComponent` renamed to `Renderable` since it should be used with `render`
- Replaced `isCoercableComponent` with `isJSXElement`
- Replaced `Computable` and `ProcessedComputable` with the vue built-ins `MaybeRefOrGetter` and `MaybeRef`
- `convertComputable` renamed to `processGetter`
- Also removed `GetComputableTypeWithDefault` and `GetComputableType`, which can similarly be replaced
- `dontMerge` is now a property on rows and columns rather than an undocumented css class you'd have to include on every feature within the row or column
- Fixed saves manager not being imported in addiction warning component
- Created `vueFeatureMixin` for simplifying the vue specific parts of a feature. Passes the component's properties in explicitly and directly from the feature itself
- All features should now return an object that includes props typed to omit the options object and satisfies the feature. This will ensure type correctness and pass-through custom properties. (see existing features for more thorough examples of changes)
- Replaced decorators with mixins, which won't require casting. Bonus amount decorators converted into generic bonus amount mixin. Removed effect decorator
- All `render` functions now return `JSX.Element`. The `JSX` variants (e.g. `renderJSX`) (except `joinJSX`) have been removed
- Moved all features that use the clickable component into the clickable folder
- Removed `small` property from clickable, since its a single css rule (`min-height: unset`) (you could add a small css class and pass small to any vue feature's classes property, though)
- Upgrades now use the clickable component
- Added ConversionType symbol
- Removed setDefault, just use `??=`
- Added isType function that uses a type symbol to check
- General cleanup
2024-11-19 08:32:45 -06:00
1e5411d279 Remove processedPropType and convert all components to composition API
Some checks failed
Run Tests / test (pull_request) Failing after 1m8s
2024-10-20 05:47:59 -05:00
2dab35f7cf Update vue 2024-10-18 07:04:26 -05:00
e0da9588d2 Move board to src/game 2024-10-18 07:02:34 -05:00
46d0a9aa2e Add some tests for boards 2024-10-18 07:02:33 -05:00
b98f6db1c4 Move printFormula to Formula.stringify and add tests for it
All checks were successful
Run Tests / test (pull_request) Successful in 2m1s
Build and Deploy / build-and-deploy (push) Successful in 54s
Run Tests / test (push) Successful in 2m3s
2024-03-29 00:24:31 -05:00
b88fa68874 Fix extends syntax
Some checks failed
Run Tests / test (pull_request) Failing after 2m4s
2024-03-28 23:40:47 -05:00
90d0307cf0 Add hotkey tests, make them pass
Includes updating vitest and supporting hotkeys with both ctrl+shift
2024-03-28 23:40:46 -05:00
1f22f506dd Add tests for tree reset propagation
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 57s
Run Tests / test (push) Successful in 2m1s
2024-02-21 04:15:49 +00:00
1e2b20a70f PR feedback 2024-02-21 01:25:52 +00:00
2e0e221010 Made modifier typing a lot less nasty 2024-02-21 01:25:52 +00:00
4092cd6d56 Add regression test for modifier.getFormula respecting enabled 2024-02-21 01:25:52 +00:00
Seth Posner
8811996f64 Add tests confirming low-input conversion values 2023-11-13 14:10:00 -08:00
eee5ac3e2d Fix passthroughs for inversions and make more operations invertible 2023-05-30 22:54:46 -05:00
63dcad4c12 Fix requirements tests 2023-05-20 08:30:07 -05:00
e896fd84cf Change formula testing values to hopefully catch any other miscalculations 2023-05-19 08:04:20 -05:00
7deacb41e1 Fixed tests 2023-05-17 08:23:10 -05:00
4e9fb1bc9b Fixed tests 2023-05-15 07:40:00 -05:00
f8095a9694 Made calculateMaxAffordable, calculateCost, and cost requirements interface a bit cleaner 2023-05-14 18:51:15 -05:00
4d7f03d543 Fix crash when calculating formula cost
Happened when spend resource was false and the formula was non-integrable, but the amount to buy were all going to be summed anyways
2023-05-05 19:11:57 -05:00
bffc27344a Fixed isInvertible and isIntegrable not working nested correctly 2023-04-30 11:49:43 -05:00
7a81157bcc Fix remaining typing issues with formula typing change 2023-04-22 18:10:32 -05:00
f7f4d0aa9f Fix non-integrable requirements crashing in cost requirements with spendResources true
(Which should be valid in the event the dev doesn't want to maximize)
2023-04-22 17:59:09 -05:00
97fcd28fe2 Change formula typing to work better 2023-04-22 17:59:05 -05:00
b6317a47e8 Fix calculate max affordable edge case 2023-04-21 23:48:19 -05:00
8806910f5e Resolving problems 2023-04-19 21:37:28 -05:00
f0fd926cec Update package-lock.json and snapshots 2023-04-19 19:17:36 -05:00
0f2cc45a7e Add else statement to conditional formulas 2023-04-18 20:56:23 -05:00
1928be236d Add tests for modifiers 2023-04-15 22:43:42 -05:00
7693aae4bf Minor cleanup of tests 2023-04-04 23:20:31 -05:00
0614f14ad6 Added tests for conversions 2023-04-04 23:14:35 -05:00
7e7a36bb78 Add summedPurchases param for buy max utilities 2023-04-02 16:41:39 -05:00
fb360c72c5 Add some more tests 2023-04-02 15:16:47 -05:00
0c1410a1c1 Remove a handful of long-running tests 2023-04-02 15:04:31 -05:00
8dc0c6c55c All tests pass now 2023-04-02 15:02:43 -05:00
6115b6687d Fixing more tests with integral rework 2023-04-02 00:33:11 -05:00
a91efffd5c WIP integral rework 2023-04-01 15:55:17 -05:00
f47cc23eea Add some test TODOs 2023-03-23 20:16:59 -05:00
f94c0c1f68 Add some more tests for step-wise and conditional formulas 2023-03-23 20:00:06 -05:00
3b4c098f9e Fix some formula tests 2023-03-23 19:59:45 -05:00
6e4c61155a Re-organize formulas for better readability/maintainability 2023-03-23 19:04:07 -05:00
bb0f83e75a Make tests faster 2023-03-23 11:47:39 -05:00
3078584043 Rewrite integration to handle nested formulas properly
And more clearly defines which formulas are supported
2023-03-23 11:43:44 -05:00
5afb691b30 Fix more tests 2023-03-21 00:15:28 -05:00
922b138a5b Fix test 2023-02-16 20:30:39 -06:00
d3f5e3bed7 Fix some merge issues 2023-02-15 21:08:10 -06:00
dcb3bc949d Change buyMax to maximize on repeatables, and make requirements report ability to maximize
Also fixes up some of the requirements tests that weren't actually asserting
2023-02-15 20:33:53 -06:00
8987c0c69f More test fixes 2023-02-15 20:32:30 -06:00
553c6a4554 Make clamping functions pass-throughs for inverting 2023-02-15 20:32:27 -06:00
fd925071e5 Fix some tests 2023-02-15 20:32:24 -06:00