TYPESAFETY: FactionName (#644)

This commit is contained in:
Snarling
2023-06-25 22:53:35 -04:00
committed by GitHub
parent 1de676972f
commit 9a0a843ffc
31 changed files with 295 additions and 751 deletions
+3 -3
View File
@@ -7,7 +7,7 @@ import { Typography } from "@mui/material";
interface FactionInfoParams {
infoText?: JSX.Element;
enemies?: string[];
enemies?: FactionName[];
offerHackingWork?: boolean;
offerFieldWork?: boolean;
offerSecurityWork?: boolean;
@@ -19,7 +19,7 @@ interface FactionInfoParams {
/** Contains the "information" property for all the Factions, which is just a description of each faction */
export class FactionInfo {
/** The names of all other factions considered to be enemies to this faction. */
enemies: string[];
enemies: FactionName[];
/** The descriptive text to show on the faction's page. */
infoText: JSX.Element;
@@ -60,7 +60,7 @@ export class FactionInfo {
}
/** A map of all factions and associated info to them. */
export const FactionInfos: Record<string, FactionInfo> = {
export const FactionInfos: Record<FactionName, FactionInfo> = {
// Endgame
[FactionName.Illuminati]: new FactionInfo({
infoText: (