//! Rhai integration for the SAL Core package
//!
//! This module provides a unified registration function for all core-related
//! Rhai bindings.

use rhai::{Engine, EvalAltResult};

// Re-export the individual module registration functions
pub use crate::heroscript::rhai::register_heroscript_module;
pub use crate::net::rhai::register_net_module;
pub use crate::text::rhai::register_text_module;

/// Register all core module functions with the Rhai engine
///
/// This is a convenience function that registers all available core modules
/// at once.
///
/// # Arguments
///
/// * `engine` - The Rhai engine to register the functions with
///
/// # Returns
///
/// * `Result<(), Box<EvalAltResult>>` - Ok if registration was successful, Err otherwise
pub fn register_core_module(engine: &mut Engine) -> Result<(), Box<EvalAltResult>> {
    register_text_module(engine)?;
    register_net_module(engine)?;
    register_heroscript_module(engine)?;

    Ok(())
}
