}
}
+ fn any_expired(&self) -> bool {
+ dbg!(self.users.iter().any(|ust| ust.remaining < TVL::zero()))
+ }
+
fn implies_running(&self, held: Option<PlayerId>) -> Option<User> {
if_chain! {
if let Some(Current { user }) = self.current;
if held.is_none();
- if self.users[user].remaining >= TVL::zero();
+ if ! self.any_expired();
then { Some(user) }
else { None }
}
Running,
ActiveHeld,
Inactive,
+ OtherFlag,
Stopped,
Reset,
Flag,
if let Some(current) = &state.current {
if current.user != user {
URS::Inactive
+ } else if state.any_expired() {
+ URS::OtherFlag
} else if held.is_some() {
URS::ActiveHeld
} else {
if let Some(was_current) = was_current;
if let Some(now_current) = state.current;
if now_current != was_current;
+ if ! state.any_expired();
then {
let remaining = &mut state.users[now_current.user].remaining;
*remaining = *remaining + spec.per_move();
let (text, background, sigil) = match self {
Running => ("black", "yellow", "▶" /* > */ ),
ActiveHeld => ("black", "yellow", "‖" /* || */ ),
+ OtherFlag => ("black", "yellow", ":" ),
Inactive => ("black", "white", ":" ),
Stopped => ("black", "lightblue", "□" /* [] */ ),
Reset => ("black", "lightgreen", "○" /* O */ ),