chiark / gitweb /
wip cli
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 4 Aug 2020 23:01:50 +0000 (00:01 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 4 Aug 2020 23:01:50 +0000 (00:01 +0100)
demo/test.game.toml [new file with mode: 0644]
demo/test.table.toml [new file with mode: 0644]
src/bin/otter.rs [new file with mode: 0644]
src/spec.rs

diff --git a/demo/test.game.toml b/demo/test.game.toml
new file mode 100644 (file)
index 0000000..46823f5
--- /dev/null
@@ -0,0 +1,5 @@
+table = [300, 100]
+
+[[pieces]]
+pos = [90,80]
+type = "Disc"
diff --git a/demo/test.table.toml b/demo/test.table.toml
new file mode 100644 (file)
index 0000000..d3ecd4c
--- /dev/null
@@ -0,0 +1,9 @@
+[[players]]
+nick = "alice"
+access = "fixed"
+token = "kmqAKPwK4TfReFjMor8MJhdRPBcwIBpe"
+
+[[players]]
+nick = "bob"
+access = "fixed"
+token = "ccg9kzoTh758QrVE1xMY7BQWB36dNJTx"
diff --git a/src/bin/otter.rs b/src/bin/otter.rs
new file mode 100644 (file)
index 0000000..3582bf3
--- /dev/null
@@ -0,0 +1,7 @@
+//
+
+fn create_table() {
+  
+}
+
+fn main() { todo!() }
index ff69d38630c6a5250c1980912a71aaff9d319ac9..3aaa5165353c83d3d22500a17786be7a2405b1fc 100644 (file)
@@ -4,10 +4,8 @@
 use crate::imports::*;
 
 #[derive(Debug,Serialize,Deserialize)]
-pub struct GameSpec {
-  pub table : Pos,
+pub struct TableSpec {
   pub players : Vec<PlayerSpec>,
-  pub pieces : Vec<PiecesSpec>,
 }
 
 #[derive(Debug,Serialize,Deserialize)]
@@ -17,6 +15,12 @@ pub struct PlayerSpec {
   pub access: Box<dyn PlayerAccessSpec>,
 }
 
+#[derive(Debug,Serialize,Deserialize)]
+pub struct GameSpec {
+  pub table : Pos,
+  pub pieces : Vec<PiecesSpec>,
+}
+
 #[derive(Debug,Serialize,Deserialize)]
 pub struct PiecesSpec {
   pub pos : Option<Pos>,
@@ -30,5 +34,6 @@ pub struct PiecesSpec {
 #[typetag::serde(tag="access")]
 pub trait PlayerAccessSpec : Debug {
   #[throws(OE)]
+  /// todo const DELIVER_TOKEN_SERVER : bool; etc.
   fn deliver_token(&mut self) -> Result<(),OE>;
 }