Skip to content

Commit

Permalink
Merge pull request #159 from battlecode/show_island_count
Browse files Browse the repository at this point in the history
show island count in sidebar
  • Loading branch information
AidanBlumLevine authored Feb 5, 2023
2 parents f267e78 + b185190 commit af42086
Show file tree
Hide file tree
Showing 2 changed files with 605 additions and 571 deletions.
12 changes: 11 additions & 1 deletion client/visualizer/src/main/looper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export default class Looper {
teamNames.push(meta.teams[team].name)
teamIDs.push(meta.teams[team].teamID)
}
this.stats.initializeGame(teamNames, teamIDs)
this.stats.initializeGame(teamNames, teamIDs, match.current.mapStats.island_stats.size)
const extraInfo = (this.mapinfo ? this.mapinfo + "\n" : "") + (this.conf.doingRotate ? " (Map rotated and flipped! Disable for new matches with 'Z'.)" : "")
this.stats.setExtraInfo(extraInfo)
if (!showTourneyUpload) this.stats.hideTourneyUpload()
Expand Down Expand Up @@ -360,6 +360,16 @@ export default class Looper {
// }
// }

let t1_islands = 0
let t2_islands = 0
world.mapStats.island_stats.forEach(element => {
if(element.owner == 1)
t1_islands++
if(element.owner == 2)
t2_islands++
});
this.stats.setIslandCount(t1_islands, t2_islands)

let teamAdamantium: number[] = []
let teamMana: number[] = []
let teamElixir: number[] = []
Expand Down
Loading

0 comments on commit af42086

Please sign in to comment.