pub use otter::global::InstanceName;
pub use otter::mgmtchannel::MgmtChannel;
pub use otter::spec::{Coord, Pos, PosC};
+pub use otter::toml_de;
pub use otter::ui::{AbbrevPresentationLayout, PresentationLayout};
pub type T4d = t4::WebDriver;
let path = self.game_spec_path()?;
(||{
let data = fs::read(&path).context("read")?;
- let data = toml::de::from_slice(&data).context("parse")?;
+ let data = std::str::from_utf8(&data).context("convert from UTF-8")?;
+ let data = toml_de::from_str(&data).context("parse")?;
Ok::<_,AE>(data)
})()
.context(path)
su: Setup,
alice: Window,
bob: Window,
+ spec: otter::spec::GameSpec,
}
impl Ctx {
let (mut su, inst) = setup(module_path!()).always_context("setup")?;
let [alice, bob] : [Window; 2] =
su.setup_static_users(&inst)?.try_into().unwrap();
+ let spec = su.ds.game_spec_data()?;
debug!("ok {:?} {:?}", alice, bob);
- let mut c = Ctx { su, alice, bob };
+ let mut c = Ctx { su, alice, bob, spec };
c.drag().always_context("drag")?;
let pc = c.rotate().always_context("rotate")?;