Skip to content

Commit

Permalink
simplify IsDefenceless code
Browse files Browse the repository at this point in the history
  • Loading branch information
alaingilbert committed Dec 6, 2020
1 parent a20853d commit d9f5811
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions espionageReport.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,8 @@ func (r EspionageReport) Loot(characterClass CharacterClass) Resources {
// with ships. If no ShipsInfos or DefensesInfos is including in the espionage report due to the lack of enough probes,
// the planet is assumed to be not defenceless.
func (r EspionageReport) IsDefenceless() bool {
if r.ShipsInfos() == nil || r.ShipsInfos().HasShips() {
return false
}
if r.DefensesInfos() == nil || r.DefensesInfos().HasShipDefense() {
return false
}
return true
return r.HasFleetInformation &&
r.HasDefensesInformation &&
!r.ShipsInfos().HasShips() &&
!r.DefensesInfos().HasShipDefense()
}

0 comments on commit d9f5811

Please sign in to comment.