Skip to content

Commit

Permalink
migrate task 106 to use lib-task
Browse files Browse the repository at this point in the history
  • Loading branch information
customcommander committed Oct 10, 2024
1 parent 77fb8fd commit c92a890
Showing 1 changed file with 6 additions and 19 deletions.
25 changes: 6 additions & 19 deletions src/task-106.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,13 @@
Day Laborer
*/

import {base} from './task-lib.js';
import task from './lib-task.js';

function collect(_, game_context) {
game_context.supply.food += 2;
return game_context;
}

export default base.createMachine({
initial: 'idle',
states: {
idle: {
on: {
'task.selected': {
actions: [
{type: 'game-update', params: {updater: collect}},
{type: 'task-complete'}
]
}
}
}
export default task({
id: '106',
execute: (_, game) => {
game.supply.food += 2;
return game;
}
});

0 comments on commit c92a890

Please sign in to comment.