diff options
| author | mat <git@matdoes.dev> | 2024-02-24 06:02:11 -0600 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2024-02-24 06:02:11 -0600 |
| commit | 4eeda83ba4bdb5e20c765a46e43227f4f9b39b69 (patch) | |
| tree | 479d06d13870c17abfda96d704b21cc2eb85488b /azalea-core/src | |
| parent | 64fceff1cc65ee1dd1c72f08004e40179be9f9a4 (diff) | |
| download | azalea-drasl-4eeda83ba4bdb5e20c765a46e43227f4f9b39b69.tar.xz | |
add some more convenience functions
Diffstat (limited to 'azalea-core/src')
| -rwxr-xr-x | azalea-core/src/position.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/azalea-core/src/position.rs b/azalea-core/src/position.rs index e9864035..369607c5 100755 --- a/azalea-core/src/position.rs +++ b/azalea-core/src/position.rs @@ -186,6 +186,25 @@ macro_rules! vec3_impl { } } } + + impl From<($type, $type, $type)> for $name { + #[inline] + fn from(pos: ($type, $type, $type)) -> Self { + Self::new(pos.0, pos.1, pos.2) + } + } + impl From<&($type, $type, $type)> for $name { + #[inline] + fn from(pos: &($type, $type, $type)) -> Self { + Self::new(pos.0, pos.1, pos.2) + } + } + impl From<$name> for ($type, $type, $type) { + #[inline] + fn from(pos: $name) -> Self { + (pos.x, pos.y, pos.z) + } + } }; } |
