summaryrefslogtreecommitdiff
path: root/src/map.rs
diff options
context:
space:
mode:
authortom barrett <spalf0@gmail.com>2019-08-19 02:26:17 -0500
committertom barrett <spalf0@gmail.com>2019-08-19 02:26:17 -0500
commitebf13bcd8e8ab799c56961e6bc1779bd8031a8dc (patch)
tree914274f75890fb754e698be2b06a8b2a2ef9b1d1 /src/map.rs
parent7d2c0954cd95bdabcb7ecf26f9225382ab078289 (diff)
created abstraction between world and game, added temlate for dialogtrees
Diffstat (limited to 'src/map.rs')
-rw-r--r--src/map.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/map.rs b/src/map.rs
index 124125a..9bb3b47 100644
--- a/src/map.rs
+++ b/src/map.rs
@@ -7,6 +7,7 @@ use xml::reader::XmlEvent::Characters;
use crate::constants;
use crate::entity::Operable;
use crate::layer::Layer;
+use crate::npc::Character;
use crate::tile::Tile;
use crate::tileset::Tileset;
use crate::xmlelements::XMLElements;
@@ -90,11 +91,11 @@ impl Map {
spawn_points
}
- pub fn get_spawn_points(&self, name: &str) -> Vec<Point2<f32>> {
+ pub fn get_spawn_points(&self, character: Character) -> Vec<Point2<f32>> {
self.spawns
.clone()
.into_iter()
- .filter(|s| s.0 == name)
+ .filter(|s| s.0 == character.to_str())
.map(|s| s.1)
.collect()
}