chiark / gitweb /
rename User -> Player
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 27 Jun 2020 01:01:53 +0000 (02:01 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 27 Jun 2020 01:01:53 +0000 (02:01 +0100)
src/gamestate.rs
src/global.rs

index 673d5d9921a15dbc50c479149c94d698fa86eb22..98ddebe0c6930a0d131b3691c09938250d66e3d6 100644 (file)
@@ -61,7 +61,7 @@ pub struct PieceRecord {
   pub pos : Pos,
   pub p : Box<dyn Piece>,
   pub face : FaceId,
-  pub held : Option<UserId>,
+  pub held : Option<PlayerId>,
 }
 
 #[derive(Debug)]
index f81f1b9bba88b10e90ff17ebf84530602ff90bb1..c3bf3536c62de7c98b561f31a0f639174d712ec7 100644 (file)
@@ -5,7 +5,7 @@ use crate::imports::*;
 use lazy_static::lazy_static;
 
 slotmap::new_key_type!{
-  pub struct UserId;
+  pub struct PlayerId;
   pub struct ClientId;
 }
 
@@ -18,21 +18,21 @@ impl Borrow<str> for RawToken {
 pub struct Client {
 }
 
-pub struct User {
+pub struct Player {
   pub nick : String,
   pub clients : DenseSlotMap<ClientId,Client>,
 }
 
 pub struct Instance {
   /* game state goes here */
-  pub users : DenseSlotMap<UserId,User>,
+  pub users : DenseSlotMap<PlayerId,Player>,
   pub gs : GameState,
 }
 
 #[derive(Clone)]
 pub struct InstanceAccessDetails {
   pub i : Arc<Mutex<Instance>>,
-  pub user : UserId,
+  pub user : PlayerId,
 }
 
 #[derive(Clone)]
@@ -80,7 +80,7 @@ pub fn xxx_global_setup() {
   let i = Arc::new(Mutex::new(i));
   let mut ig = i.lock().unwrap();
   for (token, nick) in XXX_USERS_TOKENS {
-    let nu = User {
+    let nu = Player {
       nick : nick.to_string(),
       clients : Default::default(),
     };