Skip to content

Commit

Permalink
chore
Browse files Browse the repository at this point in the history
  • Loading branch information
Larkooo committed Jul 18, 2024
1 parent 20e9130 commit 9f2a7e4
Showing 1 changed file with 1 addition and 37 deletions.
38 changes: 1 addition & 37 deletions src/c/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use torii_client::client::Client;
#[repr(C)]
pub enum Result<T> {
Ok(T),
#[allow(dead_code)]
Err(Error),
}
#[derive(Debug, Clone)]
Expand Down Expand Up @@ -963,43 +964,6 @@ impl From<&torii_grpc::types::Value> for Value {
}
}

pub type EntityKeys = CArray<FieldElement>;
pub type StorageKey = FieldElement;
pub type StorageValue = FieldElement;

#[derive(Clone, Debug)]
#[repr(C)]
pub struct ModelIndex {
model: FieldElement,
keys: CArray<EntityKeys>,
}

#[derive(Clone, Debug)]
#[repr(C)]
pub struct ModelStorage {
metadata: WorldMetadata,
storage: CArray<CHashItem<StorageKey, StorageValue>>,
// a map of model name to a set of entity keys.
model_index: CArray<CHashItem<FieldElement, CArray<EntityKeys>>>,
// listener for storage updates.
// senders: Mutex<HashMap<u8, Sender<()>>>,
// listeners: Mutex<HashMap<StorageKey, Vec<u8>>>,
}

// impl From<&torii_client::client::storage::ModelStorage> for ModelStorage {
// fn from(value: &torii_client::client::storage::ModelStorage) -> Self {
// let metadata = value.metadata;
// let storage = value.storage.clone();
// let model_index = value.model_index.clone();

// Self {
// metadata: (&metadata).into(),
// storage: (&storage).into(),
// model_index: (&model_index).into(),
// }
// }
// }

#[derive(Clone, Debug)]
#[repr(C)]
pub struct WorldMetadata {
Expand Down

0 comments on commit 9f2a7e4

Please sign in to comment.