How much of the world is pandemic free?
diff --git a/src/utilities/calcGlobal.ts b/src/utilities/calcGlobal.ts
index 7984592..81d182b 100644
--- a/src/utilities/calcGlobal.ts
+++ b/src/utilities/calcGlobal.ts
@@ -48,6 +48,7 @@ export const calculateGlobalSummary = (
winning: 0,
won: 0,
pandemicFree: 0,
+ underControl: 0,
}),
);
const periodSummaries = countries.reduce(
@@ -75,6 +76,15 @@ export const calculateGlobalSummary = (
) {
newGlobalPeriods[periodIndex].pandemicFree += ((1 / 186) * 100);
}
+ if (
+ country.periods[periodIndex].status === OutbreakStatus.None
+ || country.periods[periodIndex].status === OutbreakStatus.Small
+ || country.periods[periodIndex].status === OutbreakStatus.Crushing
+ || country.periods[periodIndex].status === OutbreakStatus.Winning
+ || country.periods[periodIndex].status === OutbreakStatus.Won
+ ) {
+ newGlobalPeriods[periodIndex].underControl += ((1 / 186) * 100);
+ }
return newGlobalPeriods;
},
globalPeriods,
diff --git a/src/utilities/types/data.ts b/src/utilities/types/data.ts
index 466f5d0..087a25f 100644
--- a/src/utilities/types/data.ts
+++ b/src/utilities/types/data.ts
@@ -47,4 +47,5 @@ export interface PeriodSummary {
winning: number
won: number
pandemicFree: number
+ underControl: number
}