graveyard

This commit is contained in:
stryan 2021-10-07 14:29:09 -04:00
parent f775056a98
commit b374f4e1bd
3 changed files with 39 additions and 0 deletions

1
go.mod
View File

@ -3,6 +3,7 @@ module git.saintnet.tech/tomecraft/tome_ws
go 1.16 go 1.16
require ( require (
git.saintnet.tech/tomecraft/tome_game v0.1.5 // indirect
git.saintnet.tech/tomecraft/tome_lib v0.1.3 git.saintnet.tech/tomecraft/tome_lib v0.1.3
git.saintnet.tech/tomecraft/tome_server v0.1.3-0.20211007174247-9e34cab257fc git.saintnet.tech/tomecraft/tome_server v0.1.3-0.20211007174247-9e34cab257fc
github.com/google/uuid v1.3.0 github.com/google/uuid v1.3.0

2
go.sum
View File

@ -6,6 +6,8 @@ git.saintnet.tech/tomecraft/tome_game v0.1.1 h1:oAW/VjrpdFQ1msVml255Fo0CJ+FWQjaG
git.saintnet.tech/tomecraft/tome_game v0.1.1/go.mod h1:NvCnRvwYVZh5Qy65QxjEAaGZrnDM9bD+FlGb6oZV7y4= git.saintnet.tech/tomecraft/tome_game v0.1.1/go.mod h1:NvCnRvwYVZh5Qy65QxjEAaGZrnDM9bD+FlGb6oZV7y4=
git.saintnet.tech/tomecraft/tome_game v0.1.2-0.20211007173712-596291bbf881 h1:igUMSriLf7UKLcrQLQjbwkOuuqQglxFXF55l5C4mrGk= git.saintnet.tech/tomecraft/tome_game v0.1.2-0.20211007173712-596291bbf881 h1:igUMSriLf7UKLcrQLQjbwkOuuqQglxFXF55l5C4mrGk=
git.saintnet.tech/tomecraft/tome_game v0.1.2-0.20211007173712-596291bbf881/go.mod h1:NvCnRvwYVZh5Qy65QxjEAaGZrnDM9bD+FlGb6oZV7y4= git.saintnet.tech/tomecraft/tome_game v0.1.2-0.20211007173712-596291bbf881/go.mod h1:NvCnRvwYVZh5Qy65QxjEAaGZrnDM9bD+FlGb6oZV7y4=
git.saintnet.tech/tomecraft/tome_game v0.1.5 h1:YWpBR3qgUQxpfzo2FwLUOl8PYohgNdl/VhX+/JGFvSQ=
git.saintnet.tech/tomecraft/tome_game v0.1.5/go.mod h1:NvCnRvwYVZh5Qy65QxjEAaGZrnDM9bD+FlGb6oZV7y4=
git.saintnet.tech/tomecraft/tome_lib v0.1.1/go.mod h1:Jekqa9ojNDOrcO1aL0IWKuhCQSE5+MNHVcYtTWA6uko= git.saintnet.tech/tomecraft/tome_lib v0.1.1/go.mod h1:Jekqa9ojNDOrcO1aL0IWKuhCQSE5+MNHVcYtTWA6uko=
git.saintnet.tech/tomecraft/tome_lib v0.1.2 h1:S2BHgsWBGFv9fy+qBHuKXv0kcjT7VP/7gDmJHje/+RQ= git.saintnet.tech/tomecraft/tome_lib v0.1.2 h1:S2BHgsWBGFv9fy+qBHuKXv0kcjT7VP/7gDmJHje/+RQ=
git.saintnet.tech/tomecraft/tome_lib v0.1.2/go.mod h1:Jekqa9ojNDOrcO1aL0IWKuhCQSE5+MNHVcYtTWA6uko= git.saintnet.tech/tomecraft/tome_lib v0.1.2/go.mod h1:Jekqa9ojNDOrcO1aL0IWKuhCQSE5+MNHVcYtTWA6uko=

36
main.go
View File

@ -178,6 +178,42 @@ func console(c *coordinator.Coordinator) {
} }
} }
} }
case "grave":
if match == uuid.Nil {
fmt.Println("needs match")
continue
}
if player == -1 {
fmt.Println("needs player")
continue
}
if player == tome_lib.SentinalID {
grave := c.Matches[match].Game.SentinalGrave
fmt.Println(grave)
if len(cmd) == 3 {
crd, err := strconv.Atoi(cmd[2])
if err != nil {
fmt.Println("invalid index")
continue
}
if crd < len(grave.Cards) {
fmt.Println(view_card(grave.Cards[crd]))
}
}
} else {
grave := c.Matches[match].Game.ScourgeGrave
fmt.Println(grave)
if len(cmd) == 3 {
crd, err := strconv.Atoi(cmd[2])
if err != nil {
fmt.Println("invalid index")
continue
}
if crd < len(grave.Cards) {
fmt.Println(view_card(grave.Cards[crd]))
}
}
}
} }
case "set": case "set":
switch cmd[1] { switch cmd[1] {