refactor(simulation): move content/ under server/ (#669)
Content files (RON templates, YAML campaigns, gauntlet data) are consumed exclusively by the server. Colocate them at server/content/ and update all path references in Rust source, tooling scripts, and schema files. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -8,8 +8,8 @@
|
||||
//!
|
||||
//! ```sh
|
||||
//! # Via wrapper script (recommended):
|
||||
//! tooling/validate-ron content/global/zone-identity-spec.example.ron zone
|
||||
//! tooling/validate-ron content/global/culture-van-maanens-star.example.ron culture
|
||||
//! tooling/validate-ron server/content/global/zone-identity-spec.example.ron zone
|
||||
//! tooling/validate-ron server/content/global/culture-van-maanens-star.example.ron culture
|
||||
//!
|
||||
//! # Direct:
|
||||
//! cargo run --bin validate_ron -- <file.ron> <zone|culture>
|
||||
@@ -19,7 +19,7 @@ use std::process;
|
||||
|
||||
use clap::Parser;
|
||||
|
||||
use settled_reach_server::npc::blueprint::{CultureProfile, ZoneSpec};
|
||||
use settled_reach_server::npc::blueprint::{CultureProfile, ZoneSpec, ZoneTypeTemplate};
|
||||
|
||||
#[derive(Parser)]
|
||||
#[command(
|
||||
@@ -29,7 +29,7 @@ use settled_reach_server::npc::blueprint::{CultureProfile, ZoneSpec};
|
||||
struct Args {
|
||||
/// Path to the RON file to validate.
|
||||
file: String,
|
||||
/// Schema type: "zone" (ZoneSpec) or "culture" (CultureProfile).
|
||||
/// Schema type: "zone" (ZoneSpec), "zone_type" (ZoneTypeTemplate), or "culture" (CultureProfile).
|
||||
schema: String,
|
||||
}
|
||||
|
||||
@@ -48,7 +48,11 @@ fn main() {
|
||||
"zone" => match ron::from_str::<ZoneSpec>(&content) {
|
||||
Ok(spec) => {
|
||||
println!("Valid ZoneSpec: {} ({})", spec.label, spec.zone_type);
|
||||
println!(" {} roles, {} social sites", spec.roles.len(), spec.social_sites.len());
|
||||
println!(
|
||||
" {} roles, {} social sites",
|
||||
spec.roles.len(),
|
||||
spec.social_sites.len()
|
||||
);
|
||||
let mut warnings = 0;
|
||||
if spec.roles.is_empty() {
|
||||
eprintln!(" WARNING: no roles defined — generator will reject this");
|
||||
@@ -105,8 +109,43 @@ fn main() {
|
||||
process::exit(1);
|
||||
}
|
||||
},
|
||||
"zone_type" => match ron::from_str::<ZoneTypeTemplate>(&content) {
|
||||
Ok(template) => {
|
||||
println!("Valid ZoneTypeTemplate: {} ({})", template.label, template.id);
|
||||
println!(
|
||||
" {} roles, {} social site types",
|
||||
template.roles.len(),
|
||||
template.social_site_types.len()
|
||||
);
|
||||
let mut warnings = 0;
|
||||
if template.roles.is_empty() {
|
||||
eprintln!(" WARNING: no roles defined — generator will reject this");
|
||||
warnings += 1;
|
||||
}
|
||||
for role in &template.roles {
|
||||
if role.behavior_primitives.is_empty() {
|
||||
eprintln!(
|
||||
" WARNING: role '{}' has no behavior_primitives",
|
||||
role.id
|
||||
);
|
||||
warnings += 1;
|
||||
}
|
||||
}
|
||||
if warnings > 0 {
|
||||
process::exit(1);
|
||||
}
|
||||
}
|
||||
Err(e) => {
|
||||
eprintln!("Invalid ZoneTypeTemplate in {}:", args.file);
|
||||
eprintln!(" {}", e);
|
||||
process::exit(1);
|
||||
}
|
||||
},
|
||||
other => {
|
||||
eprintln!("Unknown schema type: '{}'. Use 'zone' or 'culture'.", other);
|
||||
eprintln!(
|
||||
"Unknown schema type: '{}'. Use 'zone', 'zone_type', or 'culture'.",
|
||||
other
|
||||
);
|
||||
process::exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user