-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
59 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
use num_traits::FromPrimitive; | ||
|
||
#[derive(Default, Clone, Copy, PartialEq, Eq, FromPrimitive)] | ||
pub enum Linecap { | ||
#[default] | ||
None = 0, | ||
KillScreenX2, | ||
} | ||
|
||
impl Linecap { | ||
pub fn enum_prev(&mut self) -> Option<Self> { | ||
FromPrimitive::from_i8(*self as i8 - 1).map(|n| std::mem::replace(self, n)) | ||
} | ||
|
||
pub fn enum_next(&mut self) -> Option<Self> { | ||
FromPrimitive::from_i8(*self as i8 + 1).map(|n| std::mem::replace(self, n)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
mod asset; | ||
mod board; | ||
pub mod drop_speed; | ||
pub mod linecap; | ||
pub mod palette; | ||
pub mod piece; | ||
pub mod player; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters