40 lines
685 B
Rust
40 lines
685 B
Rust
use std::collections::VecDeque;
|
|
|
|
use bevy::prelude::*;
|
|
|
|
#[derive(Component)]
|
|
pub struct Pom;
|
|
|
|
#[derive(Component)]
|
|
pub struct GridPosition {
|
|
pub x: u32,
|
|
pub y: u32,
|
|
}
|
|
|
|
#[derive(Component, Default)]
|
|
pub struct PathQueue {
|
|
pub steps: VecDeque<(u32, u32)>,
|
|
}
|
|
|
|
#[derive(Component, Default)]
|
|
pub enum MovingState {
|
|
#[default]
|
|
Idle,
|
|
MovingUp,
|
|
MovingDown,
|
|
MovingLeft,
|
|
MovingRight,
|
|
}
|
|
|
|
impl MovingState {
|
|
pub fn is_moving(&self) -> bool {
|
|
matches!(
|
|
self,
|
|
MovingState::MovingUp
|
|
| MovingState::MovingDown
|
|
| MovingState::MovingLeft
|
|
| MovingState::MovingRight
|
|
)
|
|
}
|
|
}
|