Public: anyone can read this; the crew can change it.
forked from trevato/cs · proposes
The round's rules stop being one 553-line file: the economy and the bomb get their own modules, and the digest does not move #188
Check · Review · Land · Live done — Landed and live in production.
`src/client/world.ts` goes from 758 lines to 645: the money moves to `src/client/economy.ts` (`priceOf`, `canBuy`, `buy`, the `CARRY` pocket limits, and the `Ammo`/`emptyAmmo` a buy hands over and a new round hands back) and the objective moves to `src/client/bomb.ts` (the `Bomb` type, `giveBomb`, `dropBomb`, `updateBomb`, `useProgress`, the two ranges and the kit's effect). Neither new module imp…
shipped production is serving it deploy ae07c2d
Sign in to join this conversation.
new above
offline
src/client/world.tsgoes from 758 lines to 645: the money moves tosrc/client/economy.ts(priceOf,canBuy,buy, theCARRYpocket limits, and theAmmo/emptyAmmoa buy hands over and a new round hands back) and the objective moves tosrc/client/bomb.ts(theBombtype,giveBomb,dropBomb,updateBomb,useProgress, the two ranges and the kit's effect). Neither new module importsworld.ts, so there is no cycle — each names the slice of the world it touches the waycombat.tsnames anActor: aBuyerand aMarketin one, aCarrierand aRoundin the other, which aWorldand aPlayersatisfy structurally. TheBombandAmmotypes moved out ofworld.tsto make that true;Playerstayed.The seam worth reading is
updateBomb: it writes the fuse, the site and the planter's money, then hands back aBombEventinstead of calling into the world, because saying a line to ten people and paying ten people for a round both need all ten — sosayandfinishRoundstay inworld.ts, in a four-linebombTick. What stayed behind and why is in the header of each file.Not one behaviour changes and the digest proves it:
ROUND,DUELand all eighty per-second checkpoints insrc/client/replay.test.tsare unchanged to the byte and green.bun testis 832 pass / 0 fail. The app bundle moves 80 raw / 132 gzipped bytes (90,429 → 90,509 and 40,801 → 40,933) — two module wrappers and different short names from the minifier — which fits the ceiling #164 set with 1,491 raw to spare, so no ceiling insrc/games.tsmoves; the log there records it.economy.test.tsandbomb.test.tsare new and mostly run on plain fixtures with no world at all (armour bought twice is not paid for twice, a buy refused once the round is live, a plant that needs the site and not just the bomb, a defuse interrupted and resumed from nothing, a kit that halves it); each was checked against a mutated rule to confirm it fails without the behaviour. The buy test moved out ofworld.test.ts; the two there that are the world's rather than the bomb's — a plant that moves the match clock, a defuse that wins the round and pays for it — stay where they are.🤖 Generated with Claude Code
Closes #113