From 859d6dfe882691f05205395ad65d54d5a4556819 Mon Sep 17 00:00:00 2001 From: Julien Calixte Date: Mon, 4 Aug 2025 23:00:11 +0200 Subject: [PATCH] feat: make the story in a board game workshop --- src/modules/5s/day-store.ts | 4 +- src/modules/5s/plan.md | 62 ++++ src/modules/5s/types/board-games.ts | 269 ++++++++++++++++++ src/modules/5s/types/data.ts | 426 ---------------------------- src/modules/5s/types/tools.ts | 19 ++ src/modules/5s/types/workshop.ts | 13 +- 6 files changed, 356 insertions(+), 437 deletions(-) create mode 100644 src/modules/5s/plan.md create mode 100644 src/modules/5s/types/board-games.ts delete mode 100644 src/modules/5s/types/data.ts create mode 100644 src/modules/5s/types/tools.ts diff --git a/src/modules/5s/day-store.ts b/src/modules/5s/day-store.ts index fea8988..7fae517 100644 --- a/src/modules/5s/day-store.ts +++ b/src/modules/5s/day-store.ts @@ -1,8 +1,8 @@ -import { Work } from '@/modules/5s/types/workshop' +import { BoardGame } from '@/modules/5s/types/workshop' import { defineStore } from 'pinia' type State = { - works: Work[] + works: BoardGame[] } export const useDayStore = defineStore('day', { diff --git a/src/modules/5s/plan.md b/src/modules/5s/plan.md new file mode 100644 index 0000000..1555350 --- /dev/null +++ b/src/modules/5s/plan.md @@ -0,0 +1,62 @@ +# Plan + +## Context + +Using these types, tools and utils: + +```ts +import { NonEmptyArray } from '@/modules/5s/types/tools' + +export type Tool = { + name: string + alias: string + cooldown: number +} + +export type Task = { + name: string + tools: NonEmptyArray +} + +export type Part = { + name: string + tasks: NonEmptyArray +} + +export type BoardGame = { + name: string + parts: NonEmptyArray +} + +export const tools: Tool[] = [ + { name: 'Card Printer', alias: 'card-printer', cooldown: 5 }, + { name: 'Miniature Mold', alias: 'mini-mold', cooldown: 15 }, + { name: 'Dice Engraver', alias: 'dice-engraver', cooldown: 10 }, + { name: 'Board Cutter', alias: 'board-cutter', cooldown: 8 }, + { name: 'Rulebook Designer', alias: 'rulebook-dzn', cooldown: 6 }, + { name: 'Box Assembler', alias: 'box-asm', cooldown: 4 }, + { name: 'Component Painter', alias: 'painter', cooldown: 12 }, + { name: 'Lamination Machine', alias: 'laminator', cooldown: 7 } +] +export type NonEmptyArray = [T, ...T[]] + +export const aliasToTool = (alias: string): Tool => + tools.find((t) => t.alias === alias)! + +export const chooseTools = (...aliases: string[]): NonEmptyArray => + aliases.map(aliasToTool) as NonEmptyArray +``` + +## Demand + +In TypeScript: + +- create 9 board games with their parts and tasks. Each board games use at least 3 differents tools and have their specific parts but 20% of parts can be reused between board games and tasks may be the same, it must be relevant, +- each game, part and task have a original name, +- one of those board games must be chess + +## Distribution + +- 70% of tasks need 2 tools, 20% just 1, and 10% need 3. +- 50% of parts have 2 taks, 30% just 1, and 20% need 3, +- 4 games have 3 parts, 2 games have 1, 2 games have 2, 1 game have 1 part. diff --git a/src/modules/5s/types/board-games.ts b/src/modules/5s/types/board-games.ts new file mode 100644 index 0000000..e821ce5 --- /dev/null +++ b/src/modules/5s/types/board-games.ts @@ -0,0 +1,269 @@ +import { chooseTools } from '@/modules/5s/types/tools' +import { BoardGame } from '@/modules/5s/types/workshop' + +export const boardGames: BoardGame[] = [ + { + name: 'Royal Chess', + parts: [ + { + name: 'Chessboard Engraving', + tasks: [ + { name: 'Cut the board base', tools: chooseTools('board-cutter') }, + { + name: 'Apply lamination', + tools: chooseTools('laminator', 'painter') + } + ] + }, + { + name: 'Piece Creation', + tasks: [ + { + name: 'Mold pawns', + tools: chooseTools('mini-mold', 'painter') + }, + { + name: 'Engrave royalty', + tools: chooseTools('dice-engraver', 'mini-mold') + }, + { + name: 'Paint pieces', + tools: chooseTools('painter') + } + ] + }, + { + name: 'Packaging', + tasks: [ + { + name: 'Assemble box', + tools: chooseTools('box-asm', 'laminator') + }, + { + name: 'Insert rulebook', + tools: chooseTools('rulebook-dzn', 'box-asm') + } + ] + } + ] + }, + { + name: 'Dungeon Quest', + parts: [ + { + name: 'Hero Cards', + tasks: [ + { + name: 'Print ability cards', + tools: chooseTools('card-printer', 'laminator') + }, + { + name: 'Paint character cards', + tools: chooseTools('painter') + } + ] + }, + { + name: 'Dungeon Tiles', + tasks: [ + { + name: 'Cut dungeon tiles', + tools: chooseTools('board-cutter', 'laminator') + } + ] + } + ] + }, + { + name: 'Alien Invasion', + parts: [ + { + name: 'Scenario Cards', + tasks: [ + { + name: 'Print scenario deck', + tools: chooseTools('card-printer', 'rulebook-dzn') + }, + { + name: 'Apply finish', + tools: chooseTools('laminator') + } + ] + } + ] + }, + { + name: 'Treasure Isles', + parts: [ + { + name: 'Treasure Tokens', + tasks: [ + { + name: 'Mold tokens', + tools: chooseTools('mini-mold', 'painter') + }, + { + name: 'Engrave serials', + tools: chooseTools('dice-engraver', 'laminator', 'painter') + } + ] + }, + { + name: 'Map Boards', + tasks: [ + { + name: 'Print map base', + tools: chooseTools('board-cutter', 'laminator') + }, + { + name: 'Add compass', + tools: chooseTools('painter') + }, + { + name: 'Seal map edges', + tools: chooseTools('laminator') + } + ] + }, + { + name: 'Game Guide', + tasks: [ + { + name: 'Design instructions', + tools: chooseTools('rulebook-dzn') + } + ] + } + ] + }, + { + name: 'Galaxy Merchant', + parts: [ + { + name: 'Trade Deck', + tasks: [ + { + name: 'Print trade cards', + tools: chooseTools('card-printer', 'laminator') + }, + { + name: 'Apply protective coating', + tools: chooseTools('laminator') + } + ] + }, + { + name: 'Ship Miniatures', + tasks: [ + { + name: 'Mold ship pieces', + tools: chooseTools('mini-mold', 'painter') + } + ] + } + ] + }, + { + name: 'Jungle Mayhem', + parts: [ + { + name: 'Board Creation', + tasks: [ + { + name: 'Print jungle layout', + tools: chooseTools('board-cutter', 'painter') + }, + { + name: 'Seal board', + tools: chooseTools('laminator') + } + ] + } + ] + }, + { + name: 'Cursed Relics', + parts: [ + { + name: 'Relic Tokens', + tasks: [ + { + name: 'Craft relics', + tools: chooseTools('mini-mold', 'dice-engraver') + } + ] + }, + { + name: 'Curse Deck', + tasks: [ + { + name: 'Design curse cards', + tools: chooseTools('card-printer', 'laminator') + }, + { + name: 'Apply paint', + tools: chooseTools('painter') + } + ] + } + ] + }, + { + name: 'Castle Siege', + parts: [ + { + name: 'Wall Tiles', + tasks: [ + { + name: 'Cut castle walls', + tools: chooseTools('board-cutter', 'painter') + }, + { + name: 'Reinforce walls', + tools: chooseTools('laminator') + } + ] + }, + { + name: 'Defender Miniatures', + tasks: [ + { + name: 'Mold defenders', + tools: chooseTools('mini-mold', 'painter', 'laminator') + }, + { + name: 'Paint coats', + tools: chooseTools('painter') + } + ] + }, + { + name: 'Rulebook', + tasks: [ + { + name: 'Write siege rules', + tools: chooseTools('rulebook-dzn') + } + ] + } + ] + }, + { + name: 'Fate Dice', + parts: [ + { + name: 'Dice Production', + tasks: [ + { + name: 'Engrave fate symbols', + tools: chooseTools('dice-engraver', 'painter') + }, + { + name: 'Color dice faces', + tools: chooseTools('painter') + } + ] + } + ] + } +] diff --git a/src/modules/5s/types/data.ts b/src/modules/5s/types/data.ts deleted file mode 100644 index c90614d..0000000 --- a/src/modules/5s/types/data.ts +++ /dev/null @@ -1,426 +0,0 @@ -// ---------------------- -// Outils globaux (16) -// ---------------------- - -import { Deliverable, Tool, Work } from '@/modules/5s/types/workshop' - -export const tools: Tool[] = [ - { name: 'Drill', alias: 'power drill', cooldown: 2 }, - { name: 'Screwdriver', alias: 'driver', cooldown: 1 }, - { name: 'Measuring Tape', alias: 'tape', cooldown: 1 }, - { name: 'Pencil', alias: 'marker', cooldown: 1 }, - { name: 'Glue Gun', alias: 'hot glue', cooldown: 1 }, - { name: 'Clamps', alias: 'fasteners', cooldown: 1 }, - { name: 'Scissors', alias: 'cutter', cooldown: 1 }, - { name: 'Ruler', alias: 'straight edge', cooldown: 1 }, - { name: 'Pruning Shears', alias: 'secateurs', cooldown: 1 }, - { name: 'Watering Can', alias: 'can', cooldown: 1 }, - { name: 'Trowel', alias: 'hand shovel', cooldown: 1 }, - { name: 'Hammer', alias: 'mallet', cooldown: 1 }, - { name: 'Saw', alias: 'handsaw', cooldown: 2 }, - { name: 'Hole Punch', alias: 'punch', cooldown: 1 }, - { name: 'Laminator', alias: 'cover sealer', cooldown: 2 }, - { name: 'Stapler', alias: 'binder', cooldown: 1 } -] - -// ---------------------- -// GARDENING (7 outils max) -// Outils utilisés : 0, 2, 3, 4, 5, 8, 10 -// ---------------------- - -export const gardening: Work = { - name: 'gardening', - deliverables: [ - { - name: 'Vegetable Patch', - activities: [ - { - name: 'Soil Preparation', - tasks: [ - { - name: 'Loosen soil and compost', - tools: [tools[10], tools[4]] - } - ] - }, - { - name: 'Plot Planning', - tasks: [ - { - name: 'Mark row layout', - tools: [tools[2], tools[3]] - } - ] - } - ] - }, - { - name: 'Compost Bin Assembly', - activities: [ - { - name: 'Cut Panels', - tasks: [ - { - name: 'Drill and shape wood panels', - tools: [tools[0], tools[5]] - } - ] - } - ] - }, - { - name: 'Shrub Pruning', - activities: [ - { - name: 'Dead Branch Removal', - tasks: [ - { - name: 'Cut branches cleanly', - tools: [tools[8]] - } - ] - } - ] - }, - { - name: 'Raised Garden Bed', - activities: [ - { - name: 'Frame Layout', - tasks: [ - { - name: 'Measure garden bed size', - tools: [tools[2], tools[3]] - } - ] - }, - { - name: 'Frame Assembly', - tasks: [ - { - name: 'Join corners with clamps', - tools: [tools[0], tools[5]] - } - ] - }, - { - name: 'Soil Filling', - tasks: [ - { - name: 'Add compost and soil', - tools: [tools[10]] - } - ] - } - ] - }, - { - name: 'Herb Garden Planters', - activities: [ - { - name: 'Trough Installation', - tasks: [ - { - name: 'Fix containers to wall', - tools: [tools[0], tools[4]] - } - ] - } - ] - }, - { - name: 'Watering Routine', - activities: [ - { - name: 'Daily Watering', - tasks: [ - { - name: 'Irrigate each section', - tools: [tools[9]] - } - ] - } - ] - }, - { - name: 'Garden Signposts', - activities: [ - { - name: 'Label Creation', - tasks: [ - { - name: 'Write and install plant tags', - tools: [tools[3], tools[0]] - } - ] - } - ] - } - ] -} - -// ---------------------- -// CABINETMAKING (7 outils max) -// Outils utilisés : 0, 1, 2, 3, 4, 5, 12 -// ---------------------- - -export const cabinetmaking: Deliverable[] = [ - { - name: 'Bookshelf', - activities: [ - { - name: 'Cut & Layout', - tasks: [ - { - name: 'Measure and saw planks', - tools: [tools[2], tools[12]] - } - ] - }, - { - name: 'Assemble Frame', - tasks: [ - { - name: 'Join pieces with clamps', - tools: [tools[0], tools[5]] - } - ] - } - ] - }, - { - name: 'Wall Cabinet', - activities: [ - { - name: 'Support Fixing', - tasks: [ - { - name: 'Drill mount points', - tools: [tools[0], tools[1]] - } - ] - }, - { - name: 'Structure Framing', - tasks: [ - { - name: 'Align and glue panels', - tools: [tools[3], tools[4]] - } - ] - } - ] - }, - { - name: 'Work Bench', - activities: [ - { - name: 'Surface Prep', - tasks: [ - { - name: 'Saw and place top', - tools: [tools[12], tools[2]] - } - ] - }, - { - name: 'Legs Mounting', - tasks: [ - { - name: 'Drill and screw base', - tools: [tools[0], tools[1]] - } - ] - }, - { - name: 'Clamping Rails', - tasks: [ - { - name: 'Fix side clamps', - tools: [tools[5]] - } - ] - } - ] - }, - { - name: 'Drawer Unit', - activities: [ - { - name: 'Slide Installation', - tasks: [ - { - name: 'Screw rails to sides', - tools: [tools[0], tools[1]] - } - ] - } - ] - }, - { - name: 'Wooden Crate', - activities: [ - { - name: 'Handle Mounting', - tasks: [ - { - name: 'Mark and screw side handles', - tools: [tools[2], tools[1]] - } - ] - } - ] - }, - { - name: 'Desk Frame', - activities: [ - { - name: 'Joint Assembly', - tasks: [ - { - name: 'Glue and press legs', - tools: [tools[4], tools[5]] - } - ] - } - ] - }, - { - name: 'Tool Wall Board', - activities: [ - { - name: 'Peg Layout', - tasks: [ - { - name: 'Drill holes for pegs', - tools: [tools[0], tools[3]] - } - ] - } - ] - } -] - -// ---------------------- -// STATIONERY (7 outils max) -// Outils utilisés : 3, 4, 6, 7, 13, 14, 15 -// ---------------------- - -export const stationery: Deliverable[] = [ - { - name: 'Notebook', - activities: [ - { - name: 'Cover Cutting', - tasks: [ - { - name: 'Trim cover edges', - tools: [tools[6], tools[7]] - } - ] - }, - { - name: 'Punch & Staple', - tasks: [ - { - name: 'Assemble pages', - tools: [tools[13], tools[15]] - } - ] - } - ] - }, - { - name: 'Greeting Card Pack', - activities: [ - { - name: 'Card Folding', - tasks: [ - { - name: 'Score and fold paper', - tools: [tools[3], tools[7]] - } - ] - } - ] - }, - { - name: 'Planner', - activities: [ - { - name: 'Cover Lamination', - tasks: [ - { - name: 'Laminate front and back', - tools: [tools[14]] - } - ] - }, - { - name: 'Hole Punching', - tasks: [ - { - name: 'Align and punch sheets', - tools: [tools[13]] - } - ] - } - ] - }, - { - name: 'Scrapbook Kit', - activities: [ - { - name: 'Element Gluing', - tasks: [ - { - name: 'Place and fix items', - tools: [tools[4]] - } - ] - } - ] - }, - { - name: 'Bookmark Set', - activities: [ - { - name: 'Cutting & Decorating', - tasks: [ - { - name: 'Shape and draw marks', - tools: [tools[6], tools[3]] - } - ] - } - ] - }, - { - name: 'Envelope Set', - activities: [ - { - name: 'Flap Assembly', - tasks: [ - { - name: 'Trim, glue, and fold', - tools: [tools[6], tools[4]] - } - ] - } - ] - }, - { - name: 'Filing Labels', - activities: [ - { - name: 'Layout & Cutting', - tasks: [ - { - name: 'Mark and cut tabs', - tools: [tools[3], tools[6]] - } - ] - } - ] - } -] diff --git a/src/modules/5s/types/tools.ts b/src/modules/5s/types/tools.ts new file mode 100644 index 0000000..5dd3a1f --- /dev/null +++ b/src/modules/5s/types/tools.ts @@ -0,0 +1,19 @@ +import { Tool } from '@/modules/5s/types/workshop' + +export const tools: Tool[] = [ + { name: 'Card Printer', alias: 'card-printer', cooldown: 5 }, + { name: 'Miniature Mold', alias: 'mini-mold', cooldown: 15 }, + { name: 'Dice Engraver', alias: 'dice-engraver', cooldown: 10 }, + { name: 'Board Cutter', alias: 'board-cutter', cooldown: 8 }, + { name: 'Rulebook Designer', alias: 'rulebook-dzn', cooldown: 6 }, + { name: 'Box Assembler', alias: 'box-asm', cooldown: 4 }, + { name: 'Component Painter', alias: 'painter', cooldown: 12 }, + { name: 'Lamination Machine', alias: 'laminator', cooldown: 7 } +] +export type NonEmptyArray = [T, ...T[]] + +export const aliasToTool = (alias: string): Tool => + tools.find((t) => t.alias === alias)! + +export const chooseTools = (...aliases: string[]): NonEmptyArray => + aliases.map(aliasToTool) as NonEmptyArray diff --git a/src/modules/5s/types/workshop.ts b/src/modules/5s/types/workshop.ts index a3fcd21..1a60d09 100644 --- a/src/modules/5s/types/workshop.ts +++ b/src/modules/5s/types/workshop.ts @@ -1,4 +1,4 @@ -type NonEmptyArray = [T, ...T[]] +import { NonEmptyArray } from '@/modules/5s/types/tools' export type Tool = { name: string @@ -11,17 +11,12 @@ export type Task = { tools: NonEmptyArray } -export type Activity = { +export type Part = { name: string tasks: NonEmptyArray } -export type Deliverable = { +export type BoardGame = { name: string - activities: NonEmptyArray -} - -export type Work = { - name: string - deliverables: NonEmptyArray + parts: NonEmptyArray }