wave_func_collapse 0.1.0

Implementation of wave function collapse algorithm
Documentation
use std::rc::Rc;

use crate::{prelude::Pack, tile::Tile};

/// Create for storing info about possible adjacent tiles.
#[derive(Debug, Clone)]
pub struct Rule {
    pub(crate) second: Rc<dyn Tile>,
}

impl PartialEq for Rule {
    fn eq(&self, other: &Self) -> bool {
        self.second.type_str() == other.second.type_str()
    }
}
impl Eq for Rule {}

impl Rule {
    /// Contructor function
    pub fn new(second: impl Pack) -> Self {
        Self {
            second: second.pack(),
        }
    }
}