diff options
Diffstat (limited to 'go/game/winCondition.go')
| -rw-r--r-- | go/game/winCondition.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/go/game/winCondition.go b/go/game/winCondition.go index 4204ccb1..d08f4135 100644 --- a/go/game/winCondition.go +++ b/go/game/winCondition.go @@ -4,6 +4,15 @@ import ( "golang.org/x/exp/slices" ) +// A WinCondition determines if there are winners using the current game state. +type WinCondition func(*LocalState) []*Player + +// DummyWinCondition always return an empty winner slice. +func DummyWinCondition(*LocalState) []*Player { + return []*Player{} +} + +// KingGame reports the winners of a game using kings. func KingGame(s *LocalState) []*Player { foundKings := map[*Player]struct{}{} for _, u := range s.Units() { |
