From 45336daf6f535d43bcd0c68337244767c10c7174 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 5 Aug 2020 00:01:50 +0100 Subject: [PATCH] wip cli --- demo/test.game.toml | 5 +++++ demo/test.table.toml | 9 +++++++++ src/bin/otter.rs | 7 +++++++ src/spec.rs | 11 ++++++++--- 4 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 demo/test.game.toml create mode 100644 demo/test.table.toml create mode 100644 src/bin/otter.rs diff --git a/demo/test.game.toml b/demo/test.game.toml new file mode 100644 index 00000000..46823f5d --- /dev/null +++ b/demo/test.game.toml @@ -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 index 00000000..d3ecd4c5 --- /dev/null +++ b/demo/test.table.toml @@ -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 index 00000000..3582bf3f --- /dev/null +++ b/src/bin/otter.rs @@ -0,0 +1,7 @@ +// + +fn create_table() { + +} + +fn main() { todo!() } diff --git a/src/spec.rs b/src/spec.rs index ff69d386..3aaa5165 100644 --- a/src/spec.rs +++ b/src/spec.rs @@ -4,10 +4,8 @@ use crate::imports::*; #[derive(Debug,Serialize,Deserialize)] -pub struct GameSpec { - pub table : Pos, +pub struct TableSpec { pub players : Vec, - pub pieces : Vec, } #[derive(Debug,Serialize,Deserialize)] @@ -17,6 +15,12 @@ pub struct PlayerSpec { pub access: Box, } +#[derive(Debug,Serialize,Deserialize)] +pub struct GameSpec { + pub table : Pos, + pub pieces : Vec, +} + #[derive(Debug,Serialize,Deserialize)] pub struct PiecesSpec { pub pos : Option, @@ -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>; } -- 2.30.2