solverforge-solver 0.11.1

Solver engine for SolverForge
Documentation
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub(crate) struct ConstructionSlotId {
    binding_index: usize,
    entity_index: usize,
}

impl ConstructionSlotId {
    pub(crate) fn new(binding_index: usize, entity_index: usize) -> Self {
        Self {
            binding_index,
            entity_index,
        }
    }

    pub(crate) fn binding_index(self) -> usize {
        self.binding_index
    }

    pub(crate) fn entity_index(self) -> usize {
        self.entity_index
    }
}

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub(crate) enum ConstructionGroupSlotKey {
    Explicit(usize),
    Targets(Vec<ConstructionSlotId>),
}

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub(crate) struct ConstructionGroupSlotId {
    group_index: usize,
    key: ConstructionGroupSlotKey,
}

impl ConstructionGroupSlotId {
    pub(crate) fn new(group_index: usize, key: ConstructionGroupSlotKey) -> Self {
        Self { group_index, key }
    }

    pub(crate) fn group_index(&self) -> usize {
        self.group_index
    }

    pub(crate) fn key(&self) -> &ConstructionGroupSlotKey {
        &self.key
    }
}

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub(crate) struct ConstructionListElementId {
    list_index: usize,
    element_index: usize,
}

impl ConstructionListElementId {
    pub(crate) fn new(list_index: usize, element_index: usize) -> Self {
        Self {
            list_index,
            element_index,
        }
    }

    pub(crate) fn list_index(self) -> usize {
        self.list_index
    }

    pub(crate) fn element_index(self) -> usize {
        self.element_index
    }
}