summaryrefslogtreecommitdiff
path: root/src/cell.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/cell.rs')
-rw-r--r--src/cell.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/cell.rs b/src/cell.rs
index 6571cd5..d865c97 100644
--- a/src/cell.rs
+++ b/src/cell.rs
@@ -102,13 +102,13 @@ impl Cell {
}
}
- pub fn set_occupant(&mut self, occupant: Occupant, sprite: &mut TextureAtlasSprite) {
+ pub fn set_occupant(&mut self, occupant: Occupant, sprite: &mut TextureAtlas) {
self.occupant = occupant;
sprite.index = self.occupant.to_index();
}
}
-pub fn insert(mut q: Query<(&mut Cell, &mut TextureAtlasSprite)>) {
+pub fn insert(mut q: Query<(&mut Cell, &mut TextureAtlas)>) {
for (mut cell, mut sprite) in q.iter_mut() {
if cell.occupant == Occupant::None && cell.y == constants::GRID_SIZE - 1 {
cell.set_occupant(rand::random(), &mut sprite);
@@ -129,7 +129,7 @@ pub fn start_explosion(
}
}
-pub fn check(mut q: Query<(&mut Cell, &mut TextureAtlasSprite)>) {
+pub fn check(mut q: Query<(&mut Cell, &mut TextureAtlas)>) {
let mut cells = [[Cell::default(); constants::GRID_SIZE]; constants::GRID_SIZE];
for (cell, _) in q.iter_mut() {
cells[cell.x][cell.y] = *cell;
@@ -185,7 +185,7 @@ pub fn check(mut q: Query<(&mut Cell, &mut TextureAtlasSprite)>) {
}
}
-pub fn falling(mut q: Query<(&mut Cell, &mut TextureAtlasSprite)>) {
+pub fn falling(mut q: Query<(&mut Cell, &mut TextureAtlas)>) {
let mut have_gems = Vec::new();
for (cell, _sprite) in q.iter_mut() {
if cell.occupant != Occupant::None {