Change position format for blueprint
This commit is contained in:
parent
e969ba848b
commit
fec7dd70db
6 changed files with 115 additions and 79 deletions
|
|
@ -72,3 +72,22 @@ impl From<(i32, i32)> for Position {
|
|||
Position::new(value.0, value.1)
|
||||
}
|
||||
}
|
||||
|
||||
impl std::ops::Mul<i32> for Position {
|
||||
type Output = Position;
|
||||
|
||||
fn mul(mut self, rhs: i32) -> Self::Output {
|
||||
self.x *= rhs;
|
||||
self.y *= rhs;
|
||||
self
|
||||
}
|
||||
}
|
||||
impl std::ops::Mul<Position> for i32 {
|
||||
type Output = Position;
|
||||
|
||||
fn mul(self, mut rhs: Position) -> Self::Output {
|
||||
rhs.x *= self;
|
||||
rhs.y *= self;
|
||||
rhs
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue