Skip to content

Commit

Permalink
Print populated settlements only during simulation
Browse files Browse the repository at this point in the history
  • Loading branch information
ftomassetti committed Sep 6, 2014
1 parent fc8643d commit 48f7ca2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/civs/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
(println " bands " (n-bands-alive current-game))
(println " tribes " (n-tribes-alive current-game))
(println " chiefdoms " (n-chiefdoms-alive current-game))
(println " settlements " (.size (settlements current-game)))
(println " settlements " (.size (populated-settlements current-game)))
(println ""))))
{:facts (deref facts-by-turn), :game-snapshots (deref game-snapshots)}))

Expand Down
3 changes: 3 additions & 0 deletions src/civs/model/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,9 @@
[]
s)))

(defn populated-settlements [game]
(filter #(not (ghost-city? game (.id %))) (settlements game)))

(defn n-ghost-cities [game]
(.size (filter #(ghost-city? game (.id %)) (settlements game))))

Expand Down

0 comments on commit 48f7ca2

Please sign in to comment.