amethyst / amethyst/rustrogueliketutorial
C23. spawn_entities does not need map depth
- 主要言語
- Rust
- スター
- 970
- フォーク
- 166
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
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);
}
}
}
```
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
評価
この issue はまだ評価されていません。