Apex Raceway: Race Tracks, Laps and AI Rivals Kit
README.md
registry
The live tracks, racers, race director and oil slicks on this peer, so the race, the HUD, the AI and the tests find each other without entity references crossing the network. The components register themselves: RaceTrack adds its track, Racer adds itself, RaceDirector adds itself and OilSlick adds its puddle. Entries whose entity is gone are dropped as they are read.
Functions
track(name?):{ id, comp, data, entity }of the track with that entity name, or the first track; nil when none.tracks(): every live track entry.racers():{ [entityId] = Racer component }.director(): the first live RaceDirector on this peer, or nil.oils(): live oil slicks{ [entityId] = { p, r, by } }.on(fn): callsfn(kind, value)when a track or racer registers ("track"or"racer"); returns an unsubscribe function.setTrack(id, entry),addRacer(id, comp),setDirector(id, comp),setOil(id, rec): the registration calls the components make (nil removes).