summaryrefslogtreecommitdiff
path: root/src/engine/geometry.rs
diff options
context:
space:
mode:
authorJustin Worthe <justin@worthe-it.co.za>2018-05-09 22:51:38 +0200
committerJustin Worthe <justin@worthe-it.co.za>2018-05-09 22:51:38 +0200
commit11c791a59ac60241f253cdfb4e8765039d15edff (patch)
tree71d4df1b7dad0dfe03e25d3ef128a61927e65522 /src/engine/geometry.rs
parent057a4fe886848322adf4e48ad9709a289434dc1b (diff)
Added converting from JSON code to game engine representation
Diffstat (limited to 'src/engine/geometry.rs')
-rw-r--r--src/engine/geometry.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/engine/geometry.rs b/src/engine/geometry.rs
index f2a2522..a946bf9 100644
--- a/src/engine/geometry.rs
+++ b/src/engine/geometry.rs
@@ -5,6 +5,9 @@ pub struct Point {
}
impl Point {
+ pub fn new(x: u8, y: u8) -> Point {
+ Point { x, y }
+ }
pub fn move_left(&self) -> Option<Point> {
self.x.checked_sub(1).map(|x| Point {
x: x,