Move egg function to helpers

This commit is contained in:
Blade Barringer
2015-09-25 17:34:17 -05:00
parent 373f2757ca
commit 68cd51fbb0
3 changed files with 32 additions and 46 deletions

View File

@@ -1,5 +1,4 @@
import {each, defaults} from 'lodash';
import {translator as t} from '../helpers';
import {generateEggs} from '../helpers';
const DROP_EGGS = [
'Wolf',
@@ -13,26 +12,6 @@ const DROP_EGGS = [
'BearCub',
];
let eggs = { };
each(DROP_EGGS, (pet) => {
eggs[pet] = {
text: t(`dropEgg${pet}Text`),
mountText: t(`dropEgg${pet}MountText`),
adjective: t(`dropEgg${pet}Adjective`),
}
});
each(eggs, (egg, key) => {
return defaults(egg, {
canBuy: true,
value: 3,
key: key,
notes: t('eggNotes', {
eggText: egg.text,
eggAdjective: egg.adjective
}),
});
});
let eggs = generateEggs(DROP_EGGS, {type: 'drop', canBuy: true});
export default eggs;