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::collision_kind::CollisionKind;
use crate::lc_action::LcAction;
use crate::lc_entity_type::LcEntityType;

pub struct LcSingleActionConfig<T: LcEntityType> {
    pub action: Box<dyn LcAction<T>>,
    pub collision: CollisionKind,
}

impl<T: LcEntityType> Clone for LcSingleActionConfig<T> {
    fn clone(&self) -> Self {
        Self {
            action: self.action.clone_box(),
            collision: self.collision,
        }
    }
}

/// Untyped intermediate produced by the library's HOCON parser.
///
/// The library cannot know which concrete `LcEffect<T>` a consumer wants, so
/// `LcConfigRaw` carries the un-parsed effect HOCON value alongside the parsed
/// collision flags. Consumers finalize this into `LcConfig<T>` by feeding the
/// `effect_value` through their own effect parser.
#[derive(Clone, Debug, PartialEq)]
pub struct LcConfigRaw {
    pub effect_value: Value,
    pub collision: CollisionKind,
}