amethyst / amethyst/rustrogueliketutorial
C23. spawn_entities does not need map depth
- Lenguaje dominante
- Rust
- Estrellas
- 970
- Forks
- 166
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
Both trait functions:
```rust
trait MapBuilder {
fn spawn(map : &Map, ecs : &mut World, new_depth: i32);
}
```
```rust
pub trait MapBuilder {
fn spawn_entities(&mut self, map : &Map, ecs : &mut World, new_depth: i32);
}
```
and
```rust
pub struct SimpleMapBuilder {
map : Map,
depth: i32
}
```
do not need `new_depth` parameter and `depth` member, as `depth` is [member of `Map`](https://github.com/thebracket/rustrogueliketutorial/blob/master/chapter-23-generic-map/src/map.rs#L23).
It could simply be:
```rust
impl MapBuilder for SimpleMapBuilder {
fn spawn(map: &mut Map, ecs: &mut World) {
for room in map.rooms.iter().skip(1) {
spawner::spawn_room(world, resources, room, map.depth);
}
}
}
```
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Evaluación
Este issue todavía no se ha evaluado.