Improve common types
This commit is contained in:
parent
812f246706
commit
7d412ce610
6 changed files with 170 additions and 2 deletions
|
|
@ -1,6 +1,8 @@
|
|||
use crate::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use super::transformation;
|
||||
|
||||
pub type PositionType = i32;
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Deserialize, Serialize)]
|
||||
|
|
@ -65,3 +67,9 @@ impl std::ops::Sub for Position {
|
|||
self
|
||||
}
|
||||
}
|
||||
|
||||
impl From<(i32, i32)> for Position {
|
||||
fn from(value: (i32, i32)) -> Self {
|
||||
Position::new(value.0, value.1)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue