@@ -5,7 +5,7 @@ import { schema } from 'battlecode-schema'
55import { TeamRoundStat } from '../../../playback/RoundStat'
66import { DoubleChevronUpIcon } from '../../../icons/chevron'
77import { CurrentMap } from '../../../playback/Map'
8- import { useRound } from '../../../playback/GameRunner'
8+ import { useRound , useTurnNumber } from '../../../playback/GameRunner'
99
1010interface UnitsIconProps {
1111 teamIdx : 0 | 1
@@ -34,6 +34,8 @@ interface TeamTableProps {
3434
3535export const TeamTable : React . FC < TeamTableProps > = ( props : TeamTableProps ) => {
3636 const round = useRound ( )
37+ // force react to re-render when using turn playback
38+ const _turn = useTurnNumber ( )
3739 const teamStat = round ?. stat ?. getTeamStat ( round ?. match . game . teams [ props . teamIdx ] )
3840 const map = round ?. map
3941
@@ -63,6 +65,7 @@ export const ResourceTable: React.FC<ResourceTableProps> = ({ map, teamStat, tea
6365 let ratKingCount = 0
6466 let ratKingPercent = 0
6567 let globalCheese = 0
68+ let rawCheese = 0
6669
6770 if ( map && teamStat ) {
6871 cheeseAmount = teamStat . cheeseAmount
@@ -72,6 +75,7 @@ export const ResourceTable: React.FC<ResourceTableProps> = ({ map, teamStat, tea
7275 ratKingCount = teamStat . ratKingCount
7376 ratKingPercent = teamStat . ratKingPercent
7477 globalCheese = teamStat . globalCheeseAmount
78+ rawCheese = teamStat . globalRawCheeseAmount
7579 }
7680
7781 const formatPercent = ( val : number ) => ( val * 100 ) . toFixed ( 1 ) . toString ( ) + '%'
@@ -133,7 +137,11 @@ export const ResourceTable: React.FC<ResourceTableProps> = ({ map, teamStat, tea
133137 </ div >
134138 </ div >
135139 </ div >
136- < div className = "flex items-center w-full mt-2 mb-1 text-xs font-bold justify-around" > Global Cheese Amount: { globalCheese } </ div >
140+ < div className = "flex items-center w-full mt-2 mb-1 text-xs font-bold justify-around" >
141+ < div > Global Cheese: { globalCheese } </ div >
142+ < div > Raw Cheese: { rawCheese } </ div >
143+ </ div >
144+
137145 </ div >
138146 )
139147}
0 commit comments