summaryrefslogtreecommitdiff
path: root/src/cell.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/cell.rs')
-rw-r--r--src/cell.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cell.rs b/src/cell.rs
index b697076..10c11f0 100644
--- a/src/cell.rs
+++ b/src/cell.rs
@@ -12,6 +12,7 @@ pub enum Occupant {
Yellow,
Red,
Blue,
+ Purple,
Explosion,
}
@@ -28,6 +29,7 @@ impl Occupant {
Occupant::Yellow => constants::TILESHEET_YELLOW,
Occupant::Red => constants::TILESHEET_RED,
Occupant::Blue => constants::TILESHEET_BLUE,
+ Occupant::Purple => constants::TILESHEET_PURPLE,
Occupant::Explosion => constants::TILESHEET_EXPLOSION1,
Occupant::None => constants::TILESHEET_NONE1,
}
@@ -36,11 +38,12 @@ impl Occupant {
impl Distribution<Occupant> for Standard {
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> Occupant {
- match rng.gen_range(0..=3) {
+ match rng.gen_range(0..=4) {
0 => Occupant::Green,
1 => Occupant::Yellow,
2 => Occupant::Blue,
3 => Occupant::Red,
+ 4 => Occupant::Purple,
_ => Occupant::None,
}
}