AI Command Lab // Flight Simulator
302D: The Service Dock
Initial AI Output (Fragile)
// AI-Generated Code: Tightly Coupled
void Jump() {
// Audit Fail: Hard dependency on a specific static class.
// If AudioManager is missing, the Player script crashes.
AudioManager.Instance.PlayJump();
}
Initial AI Prompt
"You ask the AI: "Play a sound when the player jumps.""
Pilot Comm Link
Mission Objective: A skilled Navigator directs the AI to use Service Location.
Optimized Protocol
// Corrected: Decoupled & Testable
void Jump() {
// We ask for "An Audio Service", we don't care which one.
ServiceLocator.Get<IAudioService>().Play("Jump");
}