feat(simulation): NpcBlueprint struct design, RON schema, and validator CLI (#611)
Define ZoneSpec, CultureProfile, and NpcBlueprint structs with serde/RON deserialization. Ship example RON files as schema contract for the copy team (#609, #610). Add validate-ron CLI for copy team to lint their files without compiling the server. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Executable
+28
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env bash
|
||||
# RON content validator — wrapper for the Rust validate_ron binary (#611).
|
||||
#
|
||||
# Usage:
|
||||
# tooling/validate-ron <file.ron> <zone|culture>
|
||||
#
|
||||
# Examples:
|
||||
# tooling/validate-ron content/global/zone-identity-spec.example.ron zone
|
||||
# tooling/validate-ron content/global/culture-krenn.example.ron culture
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
if [ $# -lt 2 ]; then
|
||||
echo "Usage: tooling/validate-ron <file.ron> <zone|culture>"
|
||||
echo ""
|
||||
echo "Validates a RON file against the Rust struct schema."
|
||||
echo "Schema types:"
|
||||
echo " zone — ZoneSpec (zone identity spec)"
|
||||
echo " culture — CultureProfile (culture profile)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Resolve file to absolute path before changing directory
|
||||
FILE="$(realpath "$1")"
|
||||
SCHEMA="$2"
|
||||
|
||||
cd "$(dirname "$0")/../server"
|
||||
exec cargo run --quiet --bin validate_ron -- "$FILE" "$SCHEMA"
|
||||
Reference in New Issue
Block a user