rustoku_lib/core/techniques/flags.rs
1use bitflags::bitflags;
2
3bitflags! {
4 /// Bitflags indicating which human techniques are active/enabled.
5 #[repr(transparent)]
6 #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
7 pub struct TechniqueFlags: u16 {
8 /// Apply the naked singles technique.
9 const NAKED_SINGLES = 1 << 0;
10 /// Apply the hidden singles technique.
11 const HIDDEN_SINGLES = 1 << 1;
12 /// Apply the naked pairs technique.
13 const NAKED_PAIRS = 1 << 2;
14 /// Apply the hidden pairs technique.
15 const HIDDEN_PAIRS = 1 << 3;
16 /// Apply the locked candidates technique.
17 const LOCKED_CANDIDATES = 1 << 4;
18 /// Apply the X-Wing technique.
19 const XWING = 1 << 5;
20
21 /// Apply easy techniques like naked singles.
22 const EASY = Self::NAKED_SINGLES.bits() | Self::HIDDEN_SINGLES.bits();
23 /// Apply medium techniques like naked pairs.
24 const MEDIUM = Self::NAKED_PAIRS.bits() | Self::HIDDEN_PAIRS.bits() | Self::LOCKED_CANDIDATES.bits();
25 /// Apply hard techniques like X-Wings.
26 const HARD = Self::XWING.bits();
27 }
28}