Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
1464070339
|
|||
066ec431ff
|
|||
3455579be6
|
|||
5a7cb58707
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -21,3 +21,5 @@
|
|||||||
# Go workspace file
|
# Go workspace file
|
||||||
go.work
|
go.work
|
||||||
|
|
||||||
|
# Visual studio Code exclusions
|
||||||
|
.vscode/settings.json
|
||||||
|
@ -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.
|
||||||
|
|
||||||
|
[](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.
|
||||||
|
@ -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
5
go.mod
@ -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
|
||||||
)
|
)
|
||||||
|
@ -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
|
||||||
|
@ -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.
|
||||||
|
@ -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"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"cardSimEngine/cardsim"
|
|
||||||
"math"
|
"math"
|
||||||
|
|
||||||
|
"git.chromaticdragon.app/kistaro/CardSimEngine/cardsim"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
Reference in New Issue
Block a user