diff options
Diffstat (limited to 'go/game/winCondition.go')
| -rw-r--r-- | go/game/winCondition.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/go/game/winCondition.go b/go/game/winCondition.go index d08f4135..ded9b0ca 100644 --- a/go/game/winCondition.go +++ b/go/game/winCondition.go @@ -43,3 +43,14 @@ func KingGame(s *LocalState) []*Player { } return winners } + +// DeathMatch returns the players without enemy &nits. +func DeathMatch(s *LocalState) []*Player { + winners := []*Player{} + for _, p := range s.players { + if len(s.EnemyUnits(p)) == 0 { + winners = append(winners, p) + } + } + return winners +} |
