use std::ops;
use super::Vec2i32;
impl ops::Add<Self> for Vec2i32 {
type Output = Self;
fn add(self, rhs: Self) -> Self {
Self{
x: self.x + rhs.x,
y: self.y + rhs.y
}
}
}
impl ops::Add<i32> for Vec2i32 {
type Output = Self;
fn add(self, rhs: i32) -> Self {
Self{
x: self.x + rhs,
y: self.y + rhs
}
}
}
impl ops::AddAssign<Self> for Vec2i32 {
fn add_assign(&mut self, rhs: Self){
*self = Self{
x: self.x + rhs.x,
y: self.y + rhs.y
}
}
}
impl ops::AddAssign<i32> for Vec2i32 {
fn add_assign(&mut self, rhs: i32){
*self = Self{
x: self.x + rhs,
y: self.y + rhs
}
}
}
impl ops::Div<Self> for Vec2i32 {
type Output = Self;
fn div(self, rhs: Self) -> Self {
Self{
x: self.x / rhs.x,
y: self.y / rhs.y
}
}
}
impl ops::Div<i32> for Vec2i32 {
type Output = Self;
fn div(self, rhs: i32) -> Self {
Self{
x: self.x / rhs,
y: self.y / rhs
}
}
}
impl ops::DivAssign<Self> for Vec2i32 {
fn div_assign(&mut self, rhs: Self){
*self = Self{
x: self.x / rhs.x,
y: self.y / rhs.y
}
}
}
impl ops::DivAssign<i32> for Vec2i32 {
fn div_assign(&mut self, rhs: i32){
*self = Self{
x: self.x / rhs,
y: self.y / rhs
}
}
}
impl ops::Neg for Vec2i32 {
type Output = Self;
fn neg(self) -> Self {
Self{
x: -self.x,
y: -self.y,
}
}
}
impl ops::Rem<Self> for Vec2i32 {
type Output = Self;
fn rem(self, rhs: Self) -> Self {
Self{
x: self.x % rhs.x,
y: self.y % rhs.y
}
}
}
impl ops::Rem<i32> for Vec2i32 {
type Output = Self;
fn rem(self, rhs: i32) -> Self {
Self{
x: self.x % rhs,
y: self.y % rhs
}
}
}
impl ops::RemAssign<Self> for Vec2i32 {
fn rem_assign(&mut self, rhs: Self) {
*self = Self{
x: self.x % rhs.x,
y: self.y % rhs.y
}
}
}
impl ops::RemAssign<i32> for Vec2i32 {
fn rem_assign(&mut self, rhs: i32) {
*self = Self{
x: self.x % rhs,
y: self.y % rhs
}
}
}
impl ops::Sub<Self> for Vec2i32 {
type Output = Self;
fn sub(self, rhs: Self) -> Self {
Self{
x: self.x - rhs.x,
y: self.y - rhs.y
}
}
}
impl ops::Sub<i32> for Vec2i32 {
type Output = Self;
fn sub(self, rhs: i32) -> Self {
Self{
x: self.x - rhs,
y: self.y - rhs
}
}
}
impl ops::SubAssign<Self> for Vec2i32 {
fn sub_assign(&mut self, rhs: Self) {
*self = Self{
x: self.x - rhs.x,
y: self.y - rhs.y
}
}
}
impl ops::SubAssign<i32> for Vec2i32 {
fn sub_assign(&mut self, rhs: i32) {
*self = Self{
x: self.x - rhs,
y: self.y - rhs
}
}
}