Skip to content

Commit af42086

Browse files
Merge pull request #159 from battlecode/show_island_count
show island count in sidebar
2 parents f267e78 + b185190 commit af42086

File tree

2 files changed

+605
-571
lines changed

2 files changed

+605
-571
lines changed

client/visualizer/src/main/looper.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export default class Looper {
7474
teamNames.push(meta.teams[team].name)
7575
teamIDs.push(meta.teams[team].teamID)
7676
}
77-
this.stats.initializeGame(teamNames, teamIDs)
77+
this.stats.initializeGame(teamNames, teamIDs, match.current.mapStats.island_stats.size)
7878
const extraInfo = (this.mapinfo ? this.mapinfo + "\n" : "") + (this.conf.doingRotate ? " (Map rotated and flipped! Disable for new matches with 'Z'.)" : "")
7979
this.stats.setExtraInfo(extraInfo)
8080
if (!showTourneyUpload) this.stats.hideTourneyUpload()
@@ -360,6 +360,16 @@ export default class Looper {
360360
// }
361361
// }
362362

363+
let t1_islands = 0
364+
let t2_islands = 0
365+
world.mapStats.island_stats.forEach(element => {
366+
if(element.owner == 1)
367+
t1_islands++
368+
if(element.owner == 2)
369+
t2_islands++
370+
});
371+
this.stats.setIslandCount(t1_islands, t2_islands)
372+
363373
let teamAdamantium: number[] = []
364374
let teamMana: number[] = []
365375
let teamElixir: number[] = []

0 commit comments

Comments
 (0)