|
@@ -66,4 +66,43 @@ impl TileIndex {
|
|
pub fn set(&mut self, name: &str, t: Tile) {
|
|
pub fn set(&mut self, name: &str, t: Tile) {
|
|
self.tiles.insert(name.to_string(), t);
|
|
self.tiles.insert(name.to_string(), t);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ pub fn new() -> Self {
|
|
|
|
+ let mut s: Self = Self { tiles: HashMap::with_capacity(24) };
|
|
|
|
+ // s.set("", Tile::with_description("", "", ""));
|
|
|
|
+ // s.set("", Tile::new("", ""));
|
|
|
|
+ s.set("void", Tile::with_description("", "", "You can fly over the void, or fall into it"));
|
|
|
|
+ s.set("player", Tile::with_description("@", "lime", "You"));
|
|
|
|
+ s.set("player-ally", Tile::with_description("@", "green", "Another Player, an ally to you"));
|
|
|
|
+ s.set("player-neutral", Tile::with_description("@", "silver", "Another Player, neutral to you"));
|
|
|
|
+ s.set("player-enemy", Tile::with_description("@", "red", "Another Player, an enemy to you"));
|
|
|
|
+ s.set("ground-stone", Tile::with_description(".", "gray", "A stone path, you can walk over it"));
|
|
|
|
+ s.set("ground-grass", Tile::with_description(".", "green", "A grassy path, you can walk over it"));
|
|
|
|
+ s.set("ground-sand", Tile::with_description(".", "yellow", "A sandy path, you can walk over it"));
|
|
|
|
+ s.set("wall-v-stone", Tile::with_description("|", "gray", "A stone wall"));
|
|
|
|
+ s.set("wall-h-stone", Tile::with_description("-", "gray", "A stone wall"));
|
|
|
|
+ s.set("wall-v-wood", Tile::with_description("|", "brown", "A wooden wall, flammable"));
|
|
|
|
+ s.set("wall-h-wood", Tile::with_description("-", "brown", "A wooden wall, flammable"));
|
|
|
|
+ s.set("door-wood-closed", Tile::with_description("x", "brown", "A wooden door, flammable"));
|
|
|
|
+ s.set("door-wood-open", Tile::with_description("+", "brown", "A wooden door, flammable, you can walk thru it"));
|
|
|
|
+ s.set("door-stone-closed", Tile::with_description("x", "gray", "A stone door"));
|
|
|
|
+ s.set("door-stone-open", Tile::with_description("+", "gray", "A stone door, you can walk thru it"));
|
|
|
|
+ s.set("door-golden-closed", Tile::with_description("x", "gold", "A golden door, find a gold key to open"));
|
|
|
|
+ s.set("door-golden-open", Tile::with_description("+", "gold", "A golden door, you can walk thru it"));
|
|
|
|
+ s.set("gold", Tile::with_description("$", "yellow", "Gold, a common currency"));
|
|
|
|
+ s.set("gem-blue", Tile::with_description("*", "cyan", "Sapphire, a rare currency"));
|
|
|
|
+ s.set("gem-red", Tile::with_description("*", "bright red", "Ruby, a rare currency"));
|
|
|
|
+ s.set("gem-green", Tile::with_description("*", "green", "Emerald, a rare currency"));
|
|
|
|
+ s.set("gem-purple", Tile::with_description("*", "magenta", "Amethyst, a rare currency"));
|
|
|
|
+ s.set("gem-white", Tile::with_description("*", "bright white", "Quartz, a rare currency"));
|
|
|
|
+ s
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+impl Default for TileIndex {
|
|
|
|
+ fn default() -> Self {
|
|
|
|
+ let mut s = Self { tiles: HashMap::with_capacity(1) };
|
|
|
|
+ s.set("void", Tile::with_description("", "", "You can fly over the void, or fall into it"));
|
|
|
|
+ s
|
|
|
|
+ }
|
|
}
|
|
}
|