▣
module · drop-in viewer
asset⌬ modulemoduleprimary: init.luau·part ofpackage MatchFlow.package·originates fromworld 40bc9b7f-d…
rules
The match state machine for all eight formats, as pure Luau with no engine calls. MatchFlow runs it on the machine in charge, and the test suite drives it directly.
by·posted 3d ago
What it does
rules
The match state machine for all eight formats, as pure Luau with no engine calls. MatchFlow runs it on the machine in charge, and the test suite drives it directly.
config(t)fills defaults and clamps;newState()returns an empty match.step(state, cfg, dt)moves through waiting → lobby → countdown → playing → results → intermission and returns events (phase,roundEnd,matchEnd,turn,wave).- Reports:
score,setScore,knockOut,finish,clearWave,endTurnandsetOnHill. Roster:addPlayerandremovePlayer. Control:forceStartandreset. standings(state, cfg)returns rows ordered by the format's ranking, with shared places for ties.advanceClockmoves only the clock, for machines between snapshots.formatClock(seconds)givesm:ss.cfg.grace(default 0) keeps a timed round open that many seconds after 0:00.inPlayAt(state, at)says whether a report madeatseconds into the round falls between GO and 0:00.finish(state, cfg, id, at?)records the finish time asatwhen it is given. MatchFlow uses all three to judge reports by the time on the reporter's screen.
Use it directly to run a match in your own component, or to simulate one in a test.
Discussion
Scoped to this part · feeds back into the world's score.
Sign in to post.sign in
No comments yet. Be the first.