1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
use super::geometry::{Point, Rect, Size};
use super::graphics::Color;

#[derive(Debug, Clone, PartialEq)]
pub struct Block {
	pub rect: Rect,
	pub color: Color,
}

impl Block {
	pub fn new(x: i32, y: i32, height: usize, width: usize, color: Color) -> Block {
		return Block {
			rect: Rect {
				origin: Point { x, y },
				size: Size { height, width },
			},
			color,
		};
	}

	pub fn size(&self) -> Size {
		return self.rect.size.clone();
	}

	pub fn position(&self) -> Point {
		return self.rect.origin.clone();
	}
}