feat: make the story in a board game workshop

This commit is contained in:
Julien Calixte
2025-08-04 23:00:11 +02:00
parent e16bfbf6b4
commit 859d6dfe88
6 changed files with 356 additions and 437 deletions

View File

@@ -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', {

62
src/modules/5s/plan.md Normal file
View File

@@ -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<Tool>
}
export type Part = {
name: string
tasks: NonEmptyArray<Task>
}
export type BoardGame = {
name: string
parts: NonEmptyArray<Part>
}
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, ...T[]]
export const aliasToTool = (alias: string): Tool =>
tools.find((t) => t.alias === alias)!
export const chooseTools = (...aliases: string[]): NonEmptyArray<Tool> =>
aliases.map(aliasToTool) as NonEmptyArray<Tool>
```
## 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.

View File

@@ -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')
}
]
}
]
}
]

View File

@@ -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]]
}
]
}
]
}
]

View File

@@ -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, ...T[]]
export const aliasToTool = (alias: string): Tool =>
tools.find((t) => t.alias === alias)!
export const chooseTools = (...aliases: string[]): NonEmptyArray<Tool> =>
aliases.map(aliasToTool) as NonEmptyArray<Tool>

View File

@@ -1,4 +1,4 @@
type NonEmptyArray<T> = [T, ...T[]]
import { NonEmptyArray } from '@/modules/5s/types/tools'
export type Tool = {
name: string
@@ -11,17 +11,12 @@ export type Task = {
tools: NonEmptyArray<Tool>
}
export type Activity = {
export type Part = {
name: string
tasks: NonEmptyArray<Task>
}
export type Deliverable = {
export type BoardGame = {
name: string
activities: NonEmptyArray<Activity>
}
export type Work = {
name: string
deliverables: NonEmptyArray<Deliverable>
parts: NonEmptyArray<Part>
}