Reintroduce apps/arcade and the ten game crates that were ripped out of
the fork (assets, audio, blocks, coedit, gen, net, pkg, render, script,
session), from makepad-internal/dev. Reconcile against the fork's layout:
- makepad-game-sim/math come from the fork's existing libs/sim + sim/math;
the copied internal libs/game/{sim,math} are dropped and the kept game
crates plus arcade point at ../../sim and ../../sim/math.
- arcade AI is rewritten off the removed makepad-ai agent API onto the
makepad-ai-hub headless ChatProvider worker (example/cad pattern):
AiWorker{send,cancel,poll}, ai_worker_loop driving
ClaudeApiChatProvider(ClaudeCli), AiWorkerEvent availability/delta/
done/error mapped into the chat feed and authoring land_edit, with
main.rs send_message/cancel_request/event-drain rebuilt around it.
- the game-script sandbox is adapted to the fork's jailed splash storage:
every isolate gets mod.fs = splash_storage jail; splaes splash_storage
set_root_for_heap is now public so the ScriptHost (or Splash) can grant
a per-game jail root. ENT font: build.rs/dispatch.rs entities fill new
fork sim Entity/Part fields via ..Default::default(); world_raycast now
borrows mutably and returns the material id.
cargo check -p makepad-arcade and the game + arcade test suites pass.
15 lines
710 B
Rust
15 lines
710 B
Rust
fn main() {
|
|
let root = std::path::PathBuf::from("apps/arcade/resources");
|
|
let idx = makepad_game_assets::AssetIndex::build(&root);
|
|
let kits = idx.kits();
|
|
println!("{} kits, {} entries total", kits.len(), idx.len());
|
|
println!("{:<24} {:>6} {:>8} roles", "kit", "tiles", "size");
|
|
for k in &kits {
|
|
let roles: Vec<String> = k.roles.iter().map(|(r, n)| format!("{r}:{n}")).collect();
|
|
let unclassified = k.tiles - k.roles.iter().map(|(_, n)| n).sum::<u32>();
|
|
println!("{:<24} {:>6} {:>8} {} (unclassified {})",
|
|
k.pack, k.tiles,
|
|
k.tile_size.map(|s| format!("{s:.2}")).unwrap_or("-".into()),
|
|
roles.join(" "), unclassified);
|
|
}
|
|
}
|