diff --git a/bin_efo/src/commands/chr.rs b/bin_efo/src/commands/chr.rs index 505af4b..e1a8167 100644 --- a/bin_efo/src/commands/chr.rs +++ b/bin_efo/src/commands/chr.rs @@ -206,7 +206,9 @@ fn handle_create_entity( // TODO: Create real entity let _ = entity_args; - let e = Entity::default(); + // TODO: Add name, add stats repartition to clap + // TODO: Load stats to entity from clap + let e = Entity::create_rng(e_type, &RngLevel::Flawed)?; let message = &crate::success::SuccessMessages::CreatedEntity( e.name.clone(), diff --git a/lib_efo/src/entity/implementations.rs b/lib_efo/src/entity/implementations.rs index ea8324d..655e22d 100644 --- a/lib_efo/src/entity/implementations.rs +++ b/lib_efo/src/entity/implementations.rs @@ -132,7 +132,7 @@ impl Entity { } /// Create an entity using Special Rng Levels - pub fn create_rng(e_type: EntityType, rng: &RngLevel) -> Result { + pub fn create_rng(e_type: &EntityType, rng: &RngLevel) -> Result { let mut r = rand::rng(); Ok(Self { id: Uuid::new_v4(), @@ -143,7 +143,7 @@ impl Entity { position: Position::create_rng(&mut r)?, ..Default::default() }, - entity_type: e_type, + entity_type: e_type.clone(), ..Default::default() }) }