Set up a per-game interpretation layer atop the SGF, and bind all games together in a Game data structure #49

Merged
savanni merged 6 commits from feature/sgf-interpretation-layer into main 2023-07-27 22:20:24 +00:00
24 changed files with 39 additions and 30 deletions
Showing only changes of commit c51fced23a - Show all commits

View File

@ -1,4 +1,10 @@
all: test bin
test: kifu-core/test-oneshot sgf/test-oneshot
bin: kifu-gtk
changeset-dev: changeset-dev:
cd changeset && make dev cd changeset && make dev
@ -58,3 +64,6 @@ kifu-pwa/dev:
kifu-pwa/server: kifu-pwa/server:
pushd kifu/pwa && make server pushd kifu/pwa && make server
sgf/test-oneshot:
pushd sgf && make test-oneshot

24
kifu/core/Cargo.lock generated
View File

@ -120,17 +120,6 @@ dependencies = [
"syn 2.0.12", "syn 2.0.12",
] ]
[[package]]
name = "go-sgf"
version = "0.1.0"
dependencies = [
"chrono",
"nom",
"serde",
"thiserror",
"typeshare",
]
[[package]] [[package]]
name = "grid" name = "grid"
version = "0.9.0" version = "0.9.0"
@ -191,10 +180,10 @@ version = "0.1.0"
dependencies = [ dependencies = [
"chrono", "chrono",
"cool_asserts", "cool_asserts",
"go-sgf",
"grid", "grid",
"serde", "serde",
"serde_json", "serde_json",
"sgf",
"thiserror", "thiserror",
"typeshare", "typeshare",
] ]
@ -337,6 +326,17 @@ dependencies = [
"serde", "serde",
] ]
[[package]]
name = "sgf"
version = "0.1.0"
dependencies = [
"chrono",
"nom",
"serde",
"thiserror",
"typeshare",
]
[[package]] [[package]]
name = "syn" name = "syn"
version = "1.0.109" version = "1.0.109"

View File

@ -7,7 +7,7 @@ edition = "2021"
[dependencies] [dependencies]
chrono = { version = "0.4" } chrono = { version = "0.4" }
go-sgf = { path = "../../go-sgf" } sgf = { path = "../../sgf" }
grid = { version = "0.9" } grid = { version = "0.9" }
serde_json = { version = "1" } serde_json = { version = "1" }
serde = { version = "1", features = [ "derive" ] } serde = { version = "1", features = [ "derive" ] }

View File

@ -1,6 +1,6 @@
use std::{ffi::OsStr, io::Read, os::unix::ffi::OsStrExt, path::PathBuf}; use std::{ffi::OsStr, io::Read, os::unix::ffi::OsStrExt, path::PathBuf};
use go_sgf::{parse_sgf, GameTree}; use sgf::{parse_sgf, GameTree};
use thiserror::Error; use thiserror::Error;
#[derive(Error, Debug)] #[derive(Error, Debug)]
@ -63,7 +63,7 @@ impl Database {
mod test { mod test {
use super::*; use super::*;
use cool_asserts::assert_matches; use cool_asserts::assert_matches;
use go_sgf::{Date, GameType}; use sgf::{Date, GameType};
#[test] #[test]
fn it_reads_empty_database() { fn it_reads_empty_database() {

View File

@ -1,5 +1,5 @@
use go_sgf::{Date, GameTree, Rank};
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use sgf::{Date, GameTree, Rank};
use typeshare::typeshare; use typeshare::typeshare;
#[derive(Clone, Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]

View File

@ -1,6 +1,6 @@
use crate::ui::{Action, GamePreviewElement}; use crate::ui::{Action, GamePreviewElement};
use go_sgf::GameTree;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use sgf::GameTree;
use typeshare::typeshare; use typeshare::typeshare;
fn rank_strings() -> Vec<String> { fn rank_strings() -> Vec<String> {

24
kifu/gtk/Cargo.lock generated
View File

@ -545,17 +545,6 @@ dependencies = [
"system-deps", "system-deps",
] ]
[[package]]
name = "go-sgf"
version = "0.1.0"
dependencies = [
"chrono",
"nom",
"serde",
"thiserror",
"typeshare",
]
[[package]] [[package]]
name = "gobject-sys" name = "gobject-sys"
version = "0.17.4" version = "0.17.4"
@ -799,10 +788,10 @@ name = "kifu-core"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"chrono", "chrono",
"go-sgf",
"grid", "grid",
"serde", "serde",
"serde_json", "serde_json",
"sgf",
"thiserror", "thiserror",
"typeshare", "typeshare",
] ]
@ -1237,6 +1226,17 @@ dependencies = [
"serde", "serde",
] ]
[[package]]
name = "sgf"
version = "0.1.0"
dependencies = [
"chrono",
"nom",
"serde",
"thiserror",
"typeshare",
]
[[package]] [[package]]
name = "signal-hook-registry" name = "signal-hook-registry"
version = "1.4.1" version = "1.4.1"

View File

View File

@ -1,5 +1,5 @@
[package] [package]
name = "go-sgf" name = "sgf"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"