fish-lib 0.2.3

A work-in-progress fishing game library containing the game/storage logic for a discord fishing game I'm working on.
Documentation
use crate::models::item::attributes::bait::BaitAttributes;
use crate::models::item::attributes::purchasable::PurchasableAttributes;
use crate::models::item::attributes::rod::RodAttributes;
use serde::{Deserialize, Serialize};

pub mod bait;
pub mod purchasable;
pub mod rod;

#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, Serialize, Deserialize)]
pub enum ItemAttributesType {
    Bait,
    Purchasable,
    Rod,
}

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ItemAttributes {
    Bait(BaitAttributes),
    Purchasable(PurchasableAttributes),
    Rod(RodAttributes),
}

impl ItemAttributes {
    pub fn bait(level: u64) -> Self {
        Self::Bait(BaitAttributes::new(level))
    }

    pub fn purchasable(cost: u32) -> Self {
        Self::Purchasable(PurchasableAttributes::new(cost))
    }

    pub fn rod(level: u64) -> Self {
        Self::Rod(RodAttributes::new(level))
    }
}