Add feature decorator system #13
|
@ -58,6 +58,11 @@ export type GenericBonusCompletionsFeature = Replace<
|
|||
Heh, guess that's what I get for just letting it mass-import everything Heh, guess that's what I get for just letting it mass-import everything
Trust me, I've made this same mistake so many times. I wish I had a better way to hint to the IDE what the default export is expected to be called Trust me, I've made this same mistake so many times. I wish I had a better way to hint to the IDE what the default export is expected to be called
Please change this back to util/bignum Please change this back to util/bignum
Heh, guess that's what I get for just letting it mass-import everything Heh, guess that's what I get for just letting it mass-import everything
Trust me, I've made this same mistake so many times. I wish I had a better way to hint to the IDE what the default export is expected to be called Trust me, I've made this same mistake so many times. I wish I had a better way to hint to the IDE what the default export is expected to be called
|
||||
* }), bonusAmountDecorator) as GenericRepeatable & GenericBonusAmountFeature
|
||||
*/
|
||||
export const bonusAmountDecorator: Decorator<BonusAmountFeatureOptions, BaseBonusAmountFeature, GenericBonusAmountFeature> = {
|
||||
preConstruct(feature) {
|
||||
Please change this back to util/bignum Please change this back to util/bignum
Heh, guess that's what I get for just letting it mass-import everything Heh, guess that's what I get for just letting it mass-import everything
Trust me, I've made this same mistake so many times. I wish I had a better way to hint to the IDE what the default export is expected to be called Trust me, I've made this same mistake so many times. I wish I had a better way to hint to the IDE what the default export is expected to be called
|
||||
if (feature.amount === undefined) {
|
||||
Please change this back to util/bignum Please change this back to util/bignum
Heh, guess that's what I get for just letting it mass-import everything Heh, guess that's what I get for just letting it mass-import everything
Trust me, I've made this same mistake so many times. I wish I had a better way to hint to the IDE what the default export is expected to be called Trust me, I've made this same mistake so many times. I wish I had a better way to hint to the IDE what the default export is expected to be called
|
||||
console.error(`Decorated feature ${feature.id} does not contain the required 'amount' property"`);
|
||||
Please change this back to util/bignum Please change this back to util/bignum
Heh, guess that's what I get for just letting it mass-import everything Heh, guess that's what I get for just letting it mass-import everything
Trust me, I've made this same mistake so many times. I wish I had a better way to hint to the IDE what the default export is expected to be called Trust me, I've made this same mistake so many times. I wish I had a better way to hint to the IDE what the default export is expected to be called
|
||||
}
|
||||
Please change this back to util/bignum Please change this back to util/bignum
Heh, guess that's what I get for just letting it mass-import everything Heh, guess that's what I get for just letting it mass-import everything
Trust me, I've made this same mistake so many times. I wish I had a better way to hint to the IDE what the default export is expected to be called Trust me, I've made this same mistake so many times. I wish I had a better way to hint to the IDE what the default export is expected to be called
|
||||
},
|
||||
Please change this back to util/bignum Please change this back to util/bignum
Heh, guess that's what I get for just letting it mass-import everything Heh, guess that's what I get for just letting it mass-import everything
Trust me, I've made this same mistake so many times. I wish I had a better way to hint to the IDE what the default export is expected to be called Trust me, I've made this same mistake so many times. I wish I had a better way to hint to the IDE what the default export is expected to be called
|
||||
postConstruct(feature) {
|
||||
processComputable(feature, "bonusAmount");
|
||||
if (feature.totalAmount === undefined) {
|
||||
|
|
|||
Please change this back to util/bignum Please change this back to util/bignum
Heh, guess that's what I get for just letting it mass-import everything Heh, guess that's what I get for just letting it mass-import everything
Trust me, I've made this same mistake so many times. I wish I had a better way to hint to the IDE what the default export is expected to be called Trust me, I've made this same mistake so many times. I wish I had a better way to hint to the IDE what the default export is expected to be called
Please change this back to util/bignum Please change this back to util/bignum
Heh, guess that's what I get for just letting it mass-import everything Heh, guess that's what I get for just letting it mass-import everything
Trust me, I've made this same mistake so many times. I wish I had a better way to hint to the IDE what the default export is expected to be called Trust me, I've made this same mistake so many times. I wish I had a better way to hint to the IDE what the default export is expected to be called
|
|
@ -2,11 +2,11 @@ import { Replace, OptionsObject } from "../feature";
|
|||
I'm not a huge fan of adding these separators and #region comments since nowhere else in the project has them I'm not a huge fan of adding these separators and #region comments since nowhere else in the project has them
I'm not a huge fan of adding these separators and #region comments since nowhere else in the project has them I'm not a huge fan of adding these separators and #region comments since nowhere else in the project has them
|
||||
import { Computable, GetComputableType, processComputable, ProcessedComputable } from "util/computed";
|
||||
import { Persistent, State } from "game/persistence";
|
||||
|
||||
export type Decorator<FeatureOptions, BaseFeature = Object, GenericFeature = BaseFeature, S extends State = State> = {
|
||||
I'm not a huge fan of adding these separators and #region comments since nowhere else in the project has them I'm not a huge fan of adding these separators and #region comments since nowhere else in the project has them
|
||||
export type Decorator<FeatureOptions, BaseFeature = object, GenericFeature = BaseFeature, S extends State = State> = {
|
||||
I'm not a huge fan of adding these separators and #region comments since nowhere else in the project has them I'm not a huge fan of adding these separators and #region comments since nowhere else in the project has them
|
||||
getPersistentData?(): Record<string, Persistent<S>>;
|
||||
preConstruct?(feature: OptionsObject<FeatureOptions,BaseFeature,GenericFeature>): void;
|
||||
I'm not a huge fan of adding these separators and #region comments since nowhere else in the project has them I'm not a huge fan of adding these separators and #region comments since nowhere else in the project has them
|
||||
postConstruct?(feature: OptionsObject<FeatureOptions,BaseFeature,GenericFeature>): void;
|
||||
I'm not a huge fan of adding these separators and #region comments since nowhere else in the project has them I'm not a huge fan of adding these separators and #region comments since nowhere else in the project has them
|
||||
getGatheredProps?(feature: OptionsObject<FeatureOptions,BaseFeature,GenericFeature>): Partial<OptionsObject<FeatureOptions,BaseFeature,GenericFeature>>
|
||||
I'm not a huge fan of adding these separators and #region comments since nowhere else in the project has them I'm not a huge fan of adding these separators and #region comments since nowhere else in the project has them
|
||||
preConstruct?(feature: OptionsObject<FeatureOptions,BaseFeature & {id:string},GenericFeature>): void;
|
||||
I'm not a huge fan of adding these separators and #region comments since nowhere else in the project has them I'm not a huge fan of adding these separators and #region comments since nowhere else in the project has them
|
||||
postConstruct?(feature: OptionsObject<FeatureOptions,BaseFeature & {id:string},GenericFeature>): void;
|
||||
I'm not a huge fan of adding these separators and #region comments since nowhere else in the project has them I'm not a huge fan of adding these separators and #region comments since nowhere else in the project has them
|
||||
getGatheredProps?(feature: OptionsObject<FeatureOptions,BaseFeature & {id:string},GenericFeature>): Partial<OptionsObject<FeatureOptions,BaseFeature & {id:string},GenericFeature>>
|
||||
I'm not a huge fan of adding these separators and #region comments since nowhere else in the project has them I'm not a huge fan of adding these separators and #region comments since nowhere else in the project has them
|
||||
}
|
||||
|
||||
export type GenericDecorator = Decorator<unknown>;
|
||||
|
|
|||
I'm not a huge fan of adding these separators and #region comments since nowhere else in the project has them I'm not a huge fan of adding these separators and #region comments since nowhere else in the project has them
I'm not a huge fan of adding these separators and #region comments since nowhere else in the project has them I'm not a huge fan of adding these separators and #region comments since nowhere else in the project has them
|
Please change this back to util/bignum