MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / update_position_all

Function update_position_all

modules/benchmarks/src/ia_loop.rs:171–183  ·  view source on GitHub ↗
(ctx: &ReducerContext, expected: u32)

Source from the content-addressed store, hash-verified

169// ```
170#[spacetimedb::reducer]
171pub fn update_position_all(ctx: &ReducerContext, expected: u32) {
172 let mut count = 0;
173 for mut position in ctx.db.position().iter() {
174 position.x += position.vx;
175 position.y += position.vy;
176 position.z += position.vz;
177
178 let id = position.entity_id;
179 ctx.db.position().entity_id().update(position);
180 count += 1;
181 }
182 log::info!("UPDATE POSITION ALL: {expected}, processed: {count}");
183}
184
185// Simulate
186// ```

Callers 3

init_game_ia_loopMethod · 0.85
SPACETIMEDB_REDUCERFunction · 0.85
init_game_ia_loopFunction · 0.85

Calls 4

positionMethod · 0.80
iterMethod · 0.65
updateMethod · 0.45
entity_idMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…