|
|
|
|
@ -5,13 +5,14 @@ use std::path::Path; |
|
|
|
|
use bevy::prelude::*; |
|
|
|
|
|
|
|
|
|
use bevy::asset::{UntypedAssetId, VisitAssetDependencies}; |
|
|
|
|
use bevy::platform::collections::HashMap; |
|
|
|
|
use derive_where::derive_where; |
|
|
|
|
use indexmap::IndexMap; |
|
|
|
|
use serde::{Deserialize, Serialize}; |
|
|
|
|
use thiserror::Error; |
|
|
|
|
|
|
|
|
|
#[derive(Reflect, Deref)] |
|
|
|
|
#[derive_where(Deserialize, Serialize, Clone, PartialEq, Eq, Hash, Debug)] |
|
|
|
|
#[derive_where(Deserialize, Serialize)] |
|
|
|
|
#[derive_where(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)] |
|
|
|
|
#[serde(try_from = "String", into = "String")] |
|
|
|
|
pub struct Identifier<T> { |
|
|
|
|
#[deref] |
|
|
|
|
@ -118,7 +119,7 @@ impl<T> TryFrom<&Path> for Identifier<T> { |
|
|
|
|
|
|
|
|
|
#[derive(Deserialize, Serialize, Reflect, Deref, DerefMut)] |
|
|
|
|
#[derive_where(Default)] |
|
|
|
|
pub struct IdentifierMap<T, V>(HashMap<Identifier<T>, V>); |
|
|
|
|
pub struct IdentifierMap<T, V>(IndexMap<Identifier<T>, V>); |
|
|
|
|
|
|
|
|
|
impl<T, V: Clone> Clone for IdentifierMap<T, V> { |
|
|
|
|
fn clone(&self) -> Self { |
|
|
|
|
|