4 Commits

Author SHA1 Message Date
1464070339 Fix excess divider mess in message display. 2023-04-03 01:45:38 -07:00
066ec431ff Clan up go.mod. 2023-04-02 22:30:21 -07:00
3455579be6 Fix module spec. 2023-04-02 22:25:12 -07:00
5a7cb58707 Add Godoc badge 2023-04-02 22:14:11 -07:00
8 changed files with 16 additions and 11 deletions

2
.gitignore vendored
View File

@ -21,3 +21,5 @@
# Go workspace file # Go workspace file
go.work go.work
# Visual studio Code exclusions
.vscode/settings.json

View File

@ -2,6 +2,8 @@
Basic engine for NationStates-like "make decisions on issues" simulation games. Very incomplete. Basic engine for NationStates-like "make decisions on issues" simulation games. Very incomplete.
[![Go Reference](https://pkg.go.dev/badge/git.chromaticdragon.app/kistaro/CardSimEngine.svg)](https://pkg.go.dev/git.chromaticdragon.app/kistaro/CardSimEngine)
## General turn model ## General turn model
1. Player has a hand of cards. Each card has one or more actions available. 1. Player has a hand of cards. Each card has one or more actions available.

View File

@ -206,14 +206,11 @@ func displayMessageSection[C StatsCollection](p *Player[C]) bool {
if len(p.TemporaryMessages) == 0 { if len(p.TemporaryMessages) == 0 {
return false return false
} }
hasPrevious := false
for _, m := range p.TemporaryMessages { for _, m := range p.TemporaryMessages {
if m != nil { if m != nil {
if hasPrevious {
lightDivider()
}
display(m) display(m)
hasPrevious = true } else {
fmt.Println()
} }
} }
return true return true

5
go.mod
View File

@ -1,9 +1,10 @@
module cardSimEngine module git.chromaticdragon.app/kistaro/CardSimEngine
go 1.20 go 1.20
require github.com/kr/pretty v0.3.1
require ( require (
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect github.com/kr/text v0.2.0 // indirect
github.com/rogpeppe/go-internal v1.9.0 // indirect github.com/rogpeppe/go-internal v1.9.0 // indirect
) )

View File

@ -1,9 +1,10 @@
package main package main
import ( import (
"cardSimEngine/cardsim"
"errors" "errors"
"fmt" "fmt"
"git.chromaticdragon.app/kistaro/CardSimEngine/cardsim"
) )
// Type aliases, unlike distinctly named types, are fully substitutable for // Type aliases, unlike distinctly named types, are fully substitutable for

View File

@ -1,7 +1,7 @@
package main package main
import ( import (
"cardSimEngine/cardsim" "git.chromaticdragon.app/kistaro/CardSimEngine/cardsim"
) )
// SmokeTestCollection is a stats collection for the simple test sim. // SmokeTestCollection is a stats collection for the simple test sim.

View File

@ -2,9 +2,10 @@
package main package main
import ( import (
"cardSimEngine/cardsim"
"fmt" "fmt"
"git.chromaticdragon.app/kistaro/CardSimEngine/cardsim"
"github.com/kr/pretty" "github.com/kr/pretty"
) )

View File

@ -1,8 +1,9 @@
package main package main
import ( import (
"cardSimEngine/cardsim"
"math" "math"
"git.chromaticdragon.app/kistaro/CardSimEngine/cardsim"
) )
var ( var (