chiark / gitweb /
clock: Rename Current from Running
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 18 Mar 2021 23:48:07 +0000 (23:48 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 20 Mar 2021 20:12:41 +0000 (20:12 +0000)
This is the user whose turn it is but we might be paused, not running.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/clock.rs

index 13621821d7ff9a6a68ea2f634a8df3cb5831df94..3a3ab5fe5c67bf3e8bbc43791a6e0b88a31ef4d9 100644 (file)
@@ -79,14 +79,14 @@ struct Clock { // PieceTrait
 #[derive(Debug,Serialize,Deserialize)]
 struct State {
   users: [UState; 2],
-  #[serde(skip)] running: Option<Running>,
+  #[serde(skip)] current: Option<Current>,
 }
 
 impl State {
   fn new() -> Self {
     State {
       users: [UState { player: default(), remaining: TVL::zero() }; N],
-      running: None,
+      current: None,
     }
   }
 }
@@ -104,7 +104,7 @@ struct UState {
 }
 
 #[derive(Debug,Serialize,Deserialize)]
-struct Running {
+struct Current {
   user: User,
 }
 
@@ -150,8 +150,8 @@ impl Clock {
           (URS::Flag, TVL::zero())
         } else {
           (
-            if let Some(running) = &state.running {
-              if running.user != user {
+            if let Some(current) = &state.current {
+              if current.user != user {
                 URS::Inactive
               } else if held.is_some() {
                 URS::ActiveHeld