Skip to content

Commit

Permalink
Better comments
Browse files Browse the repository at this point in the history
  • Loading branch information
BobG1983 committed Jun 3, 2024
1 parent e73126c commit 4085e85
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions crates/bevy_math/src/compass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ use bevy_reflect::Reflect;
use bevy_reflect::{ReflectDeserialize, ReflectSerialize};

/// A compass enum with 4 directions.
/// [`CompassQuadrant::North`] corresponds to [`Dir2::Y`]
/// [`CompassQuadrant::East`] corresponds to [`Dir2::X`]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "bevy_reflect", derive(Reflect), reflect(Debug, PartialEq))]
Expand All @@ -15,15 +13,17 @@ use bevy_reflect::{ReflectDeserialize, ReflectSerialize};
reflect(Deserialize, Serialize)
)]
pub enum CompassQuadrant {
/// Corresponds to [`Dir2::Y`] and [`Dir2::NORTH`]
North,
/// Corresponds to [`Dir2::X`] and [`Dir2::EAST`]
East,
/// Corresponds to [`Dir2::NEG_X`] and [`Dir2::SOUTH`]
South,
/// Corresponds to [`Dir2::NEG_Y`] and [`Dir2::WEST`]
West,
}

/// A compass enum with 8 directions.
/// [`CompassQuadrant::North`] corresponds to [`Dir2::Y`]
/// [`CompassQuadrant::East`] corresponds to [`Dir2::X`]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "bevy_reflect", derive(Reflect), reflect(Debug, PartialEq))]
Expand All @@ -32,13 +32,21 @@ pub enum CompassQuadrant {
reflect(Deserialize, Serialize)
)]
pub enum CompassOctant {
/// Corresponds to [`Dir2::Y`] and [`Dir2::NORTH`]
North,
/// Corresponds to [`Dir2::NORTH_EAST`]
NorthEast,
/// Corresponds to [`Dir2::X`] and [`Dir2::EAST`]
East,
/// Corresponds to [`Dir2::SOUTH_EAST`]
SouthEast,
/// Corresponds to [`Dir2::NEG_X`] and [`Dir2::SOUTH`]
South,
/// Corresponds to [`Dir2::SOUTH_WEST`]
SouthWest,
/// Corresponds to [`Dir2::NEG_Y`] and [`Dir2::WEST`]
West,
/// Corresponds to [`Dir2::NORTH_WEST`]
NorthWest,
}

Expand Down

0 comments on commit 4085e85

Please sign in to comment.