mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-23 08:11:33 +11:00
make names better
This commit is contained in:
parent
962b503751
commit
5fc302dec9
|
@ -45,7 +45,7 @@ impl Simulation {
|
||||||
entities.add(item, location);
|
entities.add(item, location);
|
||||||
}
|
}
|
||||||
|
|
||||||
let (entities, animations) = entities.to_entity_map();
|
let (entities, animations) = entities.make_entity_map();
|
||||||
for ani in animations {
|
for ani in animations {
|
||||||
animation.populate(ani, sfx);
|
animation.populate(ani, sfx);
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,10 +34,10 @@ impl EntityMapMaker {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn add(&mut self, entity: crate::level::Item, location: Vector2D<i32>) {
|
pub fn add(&mut self, entity: crate::level::Item, location: Vector2D<i32>) {
|
||||||
let idx = self.map.push((entity, location));
|
self.map.push((entity, location));
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn to_entity_map(mut self) -> (EntityMap, Vec<AnimationInstruction>) {
|
pub fn make_entity_map(mut self) -> (EntityMap, Vec<AnimationInstruction>) {
|
||||||
self.map
|
self.map
|
||||||
.sort_unstable_by_key(|(_, location)| location.x + location.y * 100);
|
.sort_unstable_by_key(|(_, location)| location.x + location.y * 100);
|
||||||
let mut entity_map = EntityMap {
|
let mut entity_map = EntityMap {
|
||||||
|
@ -1111,7 +1111,7 @@ mod tests {
|
||||||
simulator.add(solution_entity.0, solution_entity.1);
|
simulator.add(solution_entity.0, solution_entity.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
let (mut simulator, _) = simulator.to_entity_map();
|
let (mut simulator, _) = simulator.make_entity_map();
|
||||||
|
|
||||||
for &direction in level.directions {
|
for &direction in level.directions {
|
||||||
let (outcome, _) = simulator.tick(&level.map, Action::Direction(direction));
|
let (outcome, _) = simulator.tick(&level.map, Action::Direction(direction));
|
||||||
|
|
Loading…
Reference in a new issue