AI Session API (src/ai/session.rs): - GameSession wraps Game with seeded determinism - init/init_empty, step(n), perform_action, get_state - get_cell, get_region, get_entities, get_player, count_material JSON Pipe Protocol (src/ai/protocol.rs): - --mode pipe: stdin/stdout JSON line protocol - Commands: init, step, action, get_state, get_view, get_cell, get_region, get_entities, get_player, count_material, find_material, record_start/stop, replay_save, run_scenario, quit Test Framework: - 27 Rust integration tests (tests/*.rs) covering sand, water, lava, acid, fire physics + entity movement, damage, ragdoll - 8 JSON scenarios (scenarios/*.json) runnable via --mode test - Scenario assertions: cell_is, cell_is_not, no_material_in_region, material_count_in_region, entity_alive/dead, player_on_ground, etc. Replay System (src/ai/replay.rs): - Record all actions + seed for deterministic playback - ReplayPlayer::play() and play_until_tick() for debugging - --mode replay --replay-file PATH Other changes: - src/lib.rs: library target for integration tests - Collision: post-constraint collision pass to reduce tunneling - serde + serde_json dependencies - All enums use rename_all = snake_case for JSON compatibility
14 lines
475 B
Rust
14 lines
475 B
Rust
pub mod state;
|
|
pub mod action;
|
|
pub mod session;
|
|
pub mod replay;
|
|
pub mod scenario;
|
|
pub mod protocol;
|
|
|
|
pub use state::{GameState, EntityInfo, SubBodyInfo, CellInfo, render_view, entity_kind_name};
|
|
pub use action::AiAction;
|
|
pub use session::GameSession;
|
|
pub use replay::{ReplayRecorder, ReplayPlayer, ReplayRecording};
|
|
pub use scenario::{Scenario, Assertion, AssertionResult, run_scenario, run_all_scenarios, load_scenario, format_results};
|
|
pub use protocol::run_pipe_protocol;
|