use crate::api::ResourceCategory;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum ResourceKind {
BlockStates,
BlockModel,
ItemModel,
Texture,
TextureMeta,
}
impl ResourceKind {
pub fn category(&self) -> ResourceCategory {
match self {
Self::BlockStates
| Self::BlockModel
| Self::ItemModel
| Self::Texture
| Self::TextureMeta => ResourceCategory::Assets,
}
}
pub fn extension(&self) -> &'static str {
match self {
Self::BlockStates | Self::BlockModel | Self::ItemModel => "json",
Self::Texture => "png",
Self::TextureMeta => "mcmeta",
}
}
pub fn directory(&self) -> &'static str {
match self {
Self::BlockStates => "blockstates",
Self::BlockModel => "models/block",
Self::ItemModel => "models/item",
Self::Texture | Self::TextureMeta => "textures",
}
}
}