use crate::library::{
collectable::Collectable,
collection::{CollectionItems, DynamicCollectionRules},
};
#[derive(Debug, Clone)]
pub struct CollectionCreateArgs {
name: String,
collection_type: CollectionItems,
}
impl CollectionCreateArgs {
pub fn new(name: impl Into<String>) -> Self {
Self {
name: name.into(),
collection_type: CollectionItems::Static {
collectables: Vec::new(),
},
}
}
#[must_use]
pub fn with_items(mut self, items: Vec<Collectable>) -> Self {
self.collection_type = CollectionItems::Static {
collectables: items,
};
self
}
#[must_use]
pub fn with_rules(mut self, rules: Vec<DynamicCollectionRules>) -> Self {
self.collection_type = CollectionItems::Dynamic { rules };
self
}
}