use crate::lc_action_config::LcActionConfig;
use crate::lc_entity::LcEntity;
use crate::lc_entity_type::LcEntityType;
use crate::run::run_lca;

/// Helper struct for tying together source with an action.
#[derive(Clone)]
pub struct LcSourceWithAction<T: LcEntityType> {
    pub source: LcEntity<T>,
    pub action_config: LcActionConfig<T>,
}

impl<T: LcEntityType> LcSourceWithAction<T> {
    pub fn run(&self, target: &LcEntity<T>) {
        run_lca(&self.action_config, &self.source, target);
    }
}
