From: Ian Jackson Date: Tue, 4 Aug 2020 23:01:50 +0000 (+0100) Subject: wip cli X-Git-Tag: otter-0.2.0~1184 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=45336daf6f535d43bcd0c68337244767c10c7174;p=otter.git wip cli --- 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>; }