logic_constructor 0.1.0

Move combat and ability logic out of code and into HOCON config — designers tweak damage, healing, and targeting in a text file; the engine parses it into typed actions and runs them against your entities.
Documentation
use hocon_rs::Value;

use crate::lc_action::LcAction;
use crate::lc_action_config::LcActionConfig;
use crate::lc_entity_type::LcEntityType;
use crate::parser::lc_config_list_parser::parse_lc_config_list;

/// Parses a HOCON array into a typed [`LcActionConfig<T>`] using `parse_effect`
/// for each effect body. Thin wrapper over [`parse_lc_config_list`].
pub fn parse_lc_action_config<T, F>(
    value: &Value,
    parse_effect: &F,
) -> Result<LcActionConfig<T>, String>
where
    T: LcEntityType,
    F: Fn(&Value) -> Result<Box<dyn LcAction<T>>, String>,
{
    let configs = parse_lc_config_list(value, parse_effect)?;
    Ok(configs.into())
}