Bulk insert entities with auto-incremented IDs
| 72 | |
| 73 | // Bulk insert entities with auto-incremented IDs |
| 74 | SPACETIMEDB_REDUCER(insert_bulk_entity, ReducerContext& ctx, uint32_t count) { |
| 75 | for (uint32_t id = 0; id < count; ++id) { |
| 76 | Entity new_entity = { |
| 77 | 0, // Auto-incremented by database |
| 78 | {static_cast<float>(id), static_cast<float>(id + 5)}, // position |
| 79 | id * 5 // mass |
| 80 | }; |
| 81 | ctx.db[entity].insert(new_entity); |
| 82 | } |
| 83 | LOG_INFO("INSERT ENTITY: " + std::to_string(count)); |
| 84 | return Ok(); |
| 85 | } |
| 86 | |
| 87 | // Bulk insert circles with specified entity and player IDs |
| 88 | SPACETIMEDB_REDUCER(insert_bulk_circle, ReducerContext& ctx, uint32_t count) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…