Skip to main content
Verticopolis engineGitHub

frame_view

Function frame_view 

Source
pub fn frame_view(sim: &Simulation) -> Vec<f64>
Expand description

The frame: every value a renderer reads between two structural reads, flat, so it crosses to another language as one array of numbers.

Header (FRAME_HEADER slots): 0 minutes, 1 tower revision, 2 meal overlay revision, 3 logSeq, 4 money, 5 star, 6 weather (0 clear, 1 cloudy, 2 rain), 7 santaFxSeq, 8..10 explosionFx (seq, floor, x), 11..13 thiefFx (seq, caught, floor), 14..16 treasureFx (seq, floor, x), 17 vipFxSeq, 18..20 event counts (fires, firesGutRooms, bombs), 21 a pending choice (0 or 1), 22 onHourRuns, 23 people count, 24 unit count, 25 transport count.

Then people count records of PERSON_FIXED + floors + shafts: id, seed, staff (0 or 1), state (a person state code), floor, x, fy, wait, then the routing slice the suites read: originFloor (always present, so -1 is a real basement floor), originUnitId, venueUnitId, mealVenueId (each -1 when absent), countedHotelGuest (0 or 1), routine (0 none, 1 schoolRun, 2 salesCall, 255 a routine with no code yet, which the decoder rejects), returning (0 or 1), dwellSecondsLeft (NaN when absent: a drained timer stays negative on the person through the return leg, so no number is free), the floors count, the shafts count, then the route’s floors and its shafts. Then unit count records of 6: id, state (a room state code), occupants, customersIn, hotelCustomersIn, outForMeal (an absent counter is -1). Then transport count records of 2 + 3 * cars: id, cars, then per car position, load (-1 when the shaft keeps none), direction.

crate::view::layout_json lists the person and room state codes, the weather codes and the routine codes by name.