implement blueprint creation, placement, saving and loading
This commit is contained in:
parent
3e4eb21e5e
commit
e22f568d2f
9 changed files with 281 additions and 40 deletions
|
@ -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>>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue