Skip to content

Commit

Permalink
feat: implement AddAssign, SubAssign, MulAssign, DivAssign
Browse files Browse the repository at this point in the history
  • Loading branch information
OliverNChalk committed Sep 13, 2024
1 parent 69eabc1 commit 6e3d361
Show file tree
Hide file tree
Showing 6 changed files with 389 additions and 45 deletions.
2 changes: 2 additions & 0 deletions src/cheats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ pub trait Cheats<const D: u8> {
const TWO: Self;
const TEN: Self;
const SCALING_FACTOR: Self;
const TWO_SCALING_FACTOR: Self;
}

macro_rules! impl_primitive {
Expand All @@ -13,6 +14,7 @@ macro_rules! impl_primitive {
const TEN: Self = 10;
paste! {
const SCALING_FACTOR: Self = [<10 $primitive>].pow(D as u32);
const TWO_SCALING_FACTOR: Self = 2 * [<10 $primitive>].pow(D as u32);
}
}
};
Expand Down
Loading

0 comments on commit 6e3d361

Please sign in to comment.