Improve selection system #78

Merged
CoCo_Sol merged 14 commits from improve-selection into main 2024-03-19 15:08:43 +00:00
Showing only changes of commit 270e8c54d1 - Show all commits

View file

@ -36,10 +36,10 @@ pub enum SelectedTile {
impl SelectedTile { impl SelectedTile {
/// Returns the index (ID) of the selected tile. /// Returns the index (ID) of the selected tile.
/// Returns `None` if no tile is selected. /// Returns `None` if no tile is selected.
pub fn index(&self) -> Option<u32> { pub const fn index(&self) -> Option<u32> {
match self { match self {
SelectedTile::Tile(index) => Some(*index), Self::Tile(index) => Some(*index),
SelectedTile::None => None, Self::None => None,
} }
} }
} }