implement blueprint creation, placement, saving and loading

This commit is contained in:
Crispy 2024-10-10 16:58:50 +02:00
parent 3e4eb21e5e
commit e22f568d2f
9 changed files with 281 additions and 40 deletions

View file

@ -1,3 +1,5 @@
use std::ops::Add;
use crate::{draw_scaled_texture, Textures};
use super::tile::*;
@ -50,6 +52,16 @@ impl From<Vector2> for Pos {
}
}
impl Add for Pos {
type Output = Self;
fn add(self, rhs: Self) -> Self::Output {
Self {
x: self.x + rhs.x,
y: self.y + rhs.y,
}
}
}
#[derive(Debug, Clone)]
pub struct Board {
rows: Vec<Vec<Tile>>,