diff --git a/dojo.h b/dojo.h index dea7dbd..a208c97 100644 --- a/dojo.h +++ b/dojo.h @@ -220,7 +220,7 @@ typedef struct CArray_Model { } CArray_Model; typedef struct Entity { - struct FieldElement key; + struct FieldElement id; struct CArray_Model models; } Entity; diff --git a/example/main.c b/example/main.c index 3b626c6..61d9eb4 100644 --- a/example/main.c +++ b/example/main.c @@ -133,11 +133,11 @@ int main() printf("Fetched %zu entities\n", fetchedEntities.data_len); for (size_t i = 0; i < fetchedEntities.data_len; i++) { - // pritn hex of key - printf("Key: 0x"); + // pritn hex of id + printf("entity id: 0x"); for (size_t j = 0; j < 32; j++) { - printf("%02x", fetchedEntities.data[i].key.data[j]); + printf("%02x", fetchedEntities.data[i].id.data[j]); } printf("\n"); } diff --git a/src/lib.rs b/src/lib.rs index 54382d5..8c1a665 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -227,9 +227,9 @@ pub unsafe extern "C" fn client_on_entity_state_update( (*client).runtime.spawn(async move { while let Some(Ok(entity)) = rcv.next().await { - let key: types::FieldElement = (&entity.key).into(); + let id: types::FieldElement = (&entity.id).into(); let models: Vec = entity.models.into_iter().map(|e| (&e).into()).collect(); - callback(key, models.into()); + callback(id, models.into()); } }); diff --git a/src/types.rs b/src/types.rs index b9ff9f5..71681e7 100644 --- a/src/types.rs +++ b/src/types.rs @@ -272,7 +272,7 @@ pub enum ValueType { #[derive(Clone, Debug)] #[repr(C)] pub struct Entity { - pub key: FieldElement, + pub id: FieldElement, pub models: CArray, } @@ -282,7 +282,7 @@ impl From<&Entity> for torii_grpc::types::schema::Entity { let models = models.iter().map(|m| (&m.clone()).into()).collect(); torii_grpc::types::schema::Entity { - key: (&val.key.clone()).into(), + id: (&val.id.clone()).into(), models, } } @@ -297,7 +297,7 @@ impl From<&torii_grpc::types::schema::Entity> for Entity { .collect::>(); Entity { - key: (&val.key.clone()).into(), + id: (&val.id.clone()).into(), models: models.into(), } }