diff --git a/src/components/BroadcastGraphics/Chyrons/Driver/ChyronDriver.tsx b/src/components/BroadcastGraphics/Chyrons/Driver/ChyronDriver.tsx index d3e23d9..18404a2 100644 --- a/src/components/BroadcastGraphics/Chyrons/Driver/ChyronDriver.tsx +++ b/src/components/BroadcastGraphics/Chyrons/Driver/ChyronDriver.tsx @@ -29,6 +29,9 @@ export function ChyronDriver({ chyronData, subMode }: ChyronDriverProps) { : [0, 0]; const { car, flagMode, showPosFlag, showDriverNumber } = chyronData; + const flagProps = flagMode === "country" + ? { flagMode, flag: car.driver.nationality } + : flagMode === "team" ? { flagMode, flag: car.driver.team.id } : undefined; return ( @@ -64,11 +67,12 @@ export function ChyronDriver({ chyronData, subMode }: ChyronDriverProps) { width={baseHeight * 3} right={-baseHeight * 0.6} > - + {flagProps != null && ( + + )} ); diff --git a/src/components/BroadcastGraphics/Common/AngledFlag/AngledFlag.tsx b/src/components/BroadcastGraphics/Common/AngledFlag/AngledFlag.tsx index 723a49a..fe062e2 100644 --- a/src/components/BroadcastGraphics/Common/AngledFlag/AngledFlag.tsx +++ b/src/components/BroadcastGraphics/Common/AngledFlag/AngledFlag.tsx @@ -1,16 +1,22 @@ -import { FlagMode } from "../../../../types/state"; +import { ReactNode } from "react"; +import { TeamId } from "../../../../types/state"; import { Px } from "../../../../types/style"; +import { getTeamFlagStyle } from "../../../../utils/dataLookup"; import { Container, Slant, Sheen, - CountryFlagEdge, + FlagEdge, CountryFlagDiv, FlagContainer, + TeamFlagDiv, } from "./styles"; const countryFlags = require.context("../../../../public/images/countryFlags/angled", true); -// const teamLogos = require.context("../../../../public/images/teamLogos", true); +const teamLogos = require.context("../../../../public/images/logos/team", true); + +const FLAG_WIDTH_TEAM = 2.4; +const FLAG_WIDTH_COUNTRY = 2; /** * To look right, country flags need to be 2:1. Additional editing will be @@ -19,50 +25,87 @@ const countryFlags = require.context("../../../../public/images/countryFlags/ang * center. */ type AngledFlagProps = { - flagMode: FlagMode, - flag: string, flagHeight: Px, + flagProps: { + flagMode: "country", + flag: string, + } | { + flagMode: "team", + flag: TeamId, + }, }; -export function AngledFlag({ flagMode, flag, flagHeight }: AngledFlagProps) { - const topFlag = flagMode === "country" - ? ( +export function AngledFlag(props: AngledFlagProps) { + const { flagProps, flagHeight } = props; + + let topFlag: ReactNode = null; + let bottomFlag: ReactNode = null; + + if (flagProps.flagMode === "country") { + topFlag = ( - - ) : null; // Team flag here - - const bottomFlag = flagMode === "country" - ? ( + ); + bottomFlag = ( - ) : null; // Team flag here + ); + } else if (flagProps.flagMode === "team") { + topFlag = ( + + + + ); + bottomFlag = ( + + ); + } + + const flagModeWidth = flagProps.flagMode === "team" ? FLAG_WIDTH_TEAM : FLAG_WIDTH_COUNTRY; return ( {topFlag} diff --git a/src/components/BroadcastGraphics/Common/AngledFlag/styles.ts b/src/components/BroadcastGraphics/Common/AngledFlag/styles.ts index 6ef1105..763873a 100644 --- a/src/components/BroadcastGraphics/Common/AngledFlag/styles.ts +++ b/src/components/BroadcastGraphics/Common/AngledFlag/styles.ts @@ -1,4 +1,5 @@ import styled, { css } from "styled-components"; +import { TeamFlagStyle } from "../../../../domain/data/teams"; import { Px } from "../../../../types/style"; type ContainerProps = { @@ -32,6 +33,7 @@ type FlagContainerProps = { collapsedWidth: Px, topFlag?: boolean, masked?: boolean, + teamFlag?: boolean, }; export const FlagContainer = styled.div` position: absolute; @@ -39,28 +41,28 @@ export const FlagContainer = styled.div` width: ${({ width }) => `${width}px`}; ${({ masked = false }) => masked && css` mask-image: linear-gradient( - 60deg, + to right, transparent 0%, black 15%, - black 85%, - transparent 100% + black 70%, + transparent 95% ); `} - ${({ width, collapsedWidth, topFlag = false }) => topFlag + ${({ width, collapsedWidth, topFlag = false, teamFlag = false }) => topFlag ? css` clip-path: polygon( - ${((collapsedWidth * .5) / width) * 100}% 0, - 95% 0, + ${((collapsedWidth * (teamFlag ? .415 : .5)) / width) * 100}% 0, + ${teamFlag ? 87.7 : 95}% 0, ${((1 - ((collapsedWidth * .55) / width)) * 100)}% 100%, 0 100% ); ` : css` clip-path: polygon( - ${((collapsedWidth * .5) / width) * 100}% 0, - 100% 0, - 100% 30%, + ${((collapsedWidth * (teamFlag ? .415 : .5)) / width) * 100}% 0, + ${teamFlag ? 90 : 95}% 0, + ${teamFlag ? 90 : 95}% 40%, ${((1 - ((collapsedWidth * .34) / width)) * 100)}% 100%, 0 100% ); @@ -68,24 +70,64 @@ export const FlagContainer = styled.div` `; FlagContainer.displayName = "FlagContainer"; -type CountryFlagDivProps = { +type FlagDivBaseProps = { src: string, height: Px, width: Px, - xOffset?: Px, }; -export const CountryFlagDiv = styled.div` +const FlagDivBase = styled.div` height: ${({ height }) => `${height}px`}; width: ${({ width }) => `${width}px`}; + background-color: white; background-image: url(${({ src }) => src}); - background-size: ${({ width, height }) => `${width}px ${height}px`}; background-repeat: no-repeat; +`; + +type CountryFlagDivProps = { + xOffset?: Px, +}; +export const CountryFlagDiv = styled(FlagDivBase)` + background-size: ${({ width, height }) => `${width}px ${height}px`}; ${({ xOffset }) => xOffset == null ? css`background-position: center;` : css`background-position-x: ${xOffset}px`} `; CountryFlagDiv.displayName = "CountryFlagDiv"; +type TeamFlagDivProps = { + style: TeamFlagStyle, + bottomFlag?: boolean, +}; +export const TeamFlagDiv = styled(FlagDivBase) ` + height: ${({ height }) => `${height}px`}; + width: ${({ width }) => `${width}px`}; + + background-image: url(${({ src }) => src}); + ${({ style: { backgroundColor } }) => css`background-color: ${backgroundColor};`} + + ${({ + bottomFlag, + height, + width, + style: { + imageSize, + imagePos: { x, y }, + subFlagModifier: { x: subX, y: subY, scale: subScale }, + }, + }) => bottomFlag + ? css` + background-size: ${imageSize * subScale}%; + background-position: + ${`${width * (x === 0 ? .1 : x) * subX}px + ${height * (y === 0 ? .1 : y) * subY}px`}; + ` + : css` + background-size: ${imageSize}%; + background-position: + ${`${width * x}px ${height * y}px`}; + `} +`; + type SlashProps = { x?: Px, height: Px, @@ -126,7 +168,7 @@ export const Slant = styled.div` `; Slant.displayName = "Slant"; -export const CountryFlagEdge = styled.div` +export const FlagEdge = styled.div` position: absolute; height: ${({ height }) => `${height}px`}; width: ${({ girth }) => `${girth}px`}; @@ -142,4 +184,4 @@ export const CountryFlagEdge = styled.div` black 100% ); `; -CountryFlagEdge.displayName = "CountryFlagEdge"; +FlagEdge.displayName = "FlagEdge"; diff --git a/src/components/Workspaces/CustomWorkSpaces/AngledFlagWorkSpace.tsx b/src/components/Workspaces/CustomWorkSpaces/AngledFlagWorkSpace.tsx index cfcc591..cf9244e 100644 --- a/src/components/Workspaces/CustomWorkSpaces/AngledFlagWorkSpace.tsx +++ b/src/components/Workspaces/CustomWorkSpaces/AngledFlagWorkSpace.tsx @@ -1,7 +1,7 @@ import { useSelector } from "react-redux"; import { workspaceSelector } from "../../../features/workspace/workspaceSelector"; -import { FlagMode } from "../../../types/state"; +import { FlagMode, TeamId } from "../../../types/state"; import { AngledFlag } from "../../BroadcastGraphics/Common/AngledFlag"; import { BasicBlock } from "./styles"; @@ -11,19 +11,48 @@ type AngledFlagWorkSpaceProps = { }; export function AngledFlagWorkSpace({ flagMode }: AngledFlagWorkSpaceProps) { const { prototypeState } = useSelector(workspaceSelector); + if (flagMode === "none") return null; + + const defaultTeam: TeamId = "alfaRomeo"; return ( - - + {flagMode === "country" ? ( + <> + + + + ) : flagMode === "team" ? ( + <> + + + + + ) : null} ); } diff --git a/src/components/Workspaces/PrototypingControls/AngledFlagPrototype/AngledFlagPrototypeControls.tsx b/src/components/Workspaces/PrototypingControls/AngledFlagPrototype/AngledFlagPrototypeControls.tsx index 38c3cd6..82c0baf 100644 --- a/src/components/Workspaces/PrototypingControls/AngledFlagPrototype/AngledFlagPrototypeControls.tsx +++ b/src/components/Workspaces/PrototypingControls/AngledFlagPrototype/AngledFlagPrototypeControls.tsx @@ -4,6 +4,7 @@ import { useDispatch, useSelector } from "react-redux"; import { workspaceSelector } from "../../../../features/workspace/workspaceSelector"; import { setPrototypeState } from "../../../../features/workspace/workspaceSlice"; +import { FlagMode, TeamId } from "../../../../types/state"; import { SlotSelector } from "../../../Common/Inputs/SlotSelector"; @@ -11,23 +12,52 @@ const countries = [ "GBR", "NLD", "FIN", "JPN", "FRA", "DEU", "MEX", "POL", "MCO", "CHN", "THA", "CAN", "RUS", "RAF", "AUS", "ESP", "ITA", ]; +const teams: Array = [ + "alfaRomeo", "alphaTauri", "alpine", "astonMartin", "ferrari", "haas", + "mclaren", "mercedes", "redBull", "williams", +]; -export function AngledFlagPrototypeControls() { +const DEFAULT_COUNTRY = "GBR"; +const DEFAULT_TEAM: TeamId = "alfaRomeo"; + +type AngledFlagPrototypeControlsProps = { + flagMode: FlagMode, +}; +export function AngledFlagPrototypeControls({ flagMode }: AngledFlagPrototypeControlsProps) { const dispatch = useDispatch(); const { prototypeState } = useSelector(workspaceSelector); + const flagList = flagMode === "country" ? countries : flagMode === "team" ? teams : []; const onChange = (flag: "flagA" | "flagB") => (index: number) => { - dispatch(setPrototypeState({ - angledFlag: { - flagA: flag === "flagA" ? countries[index] : prototypeState?.angledFlag?.flagA ?? "GBR", - flagB: flag === "flagB" ? countries[index] : prototypeState?.angledFlag?.flagB ?? "GBR", - }, - })); + if (flagMode === "country") { + dispatch(setPrototypeState({ + angledFlagCountry: { + flagA: flag === "flagA" + ? countries[index] + : prototypeState?.angledFlagCountry?.flagA ?? DEFAULT_COUNTRY, + flagB: flag === "flagB" + ? countries[index] + : prototypeState?.angledFlagCountry?.flagB ?? DEFAULT_COUNTRY, + }, + })); + } else if (flagMode === "team") { + dispatch(setPrototypeState({ + angledFlagTeam: { + flagA: flag === "flagA" + ? teams[index] + : prototypeState?.angledFlagTeam?.flagA ?? DEFAULT_TEAM, + flagB: flag === "flagB" + ? teams[index] + : prototypeState?.angledFlagTeam?.flagB ?? DEFAULT_TEAM, + }, + })); + + } }; return ( - - + + ); } diff --git a/src/components/Workspaces/WorkspacesRoute.tsx b/src/components/Workspaces/WorkspacesRoute.tsx index 8660810..59c3686 100644 --- a/src/components/Workspaces/WorkspacesRoute.tsx +++ b/src/components/Workspaces/WorkspacesRoute.tsx @@ -67,7 +67,14 @@ export default function Workspaces() { } - prototypeControls={} + prototypeControls={} + /> + } /> + } + prototypeControls={} /> } /> Unknown Workspace} /> diff --git a/src/domain/data/teams.ts b/src/domain/data/teams.ts index 3e53fec..53ae5db 100644 --- a/src/domain/data/teams.ts +++ b/src/domain/data/teams.ts @@ -1,5 +1,6 @@ import { theme } from "../../shared/theme"; import { Driver, Team } from "../../types/state"; +import { Percent } from "../../types/style"; import { repeater } from "../../utils/strings"; /** @@ -323,15 +324,6 @@ export type NumberStyle = { * Do not grab directly! */ export const teamNumberStyles: { [teamId: string]: NumberStyle } = { - alpine: { - numberColor: "#ddffff", - fontFamily: theme.fonts.f1Italic, - rules: [ - { type: "shadow", property: repeater("0 0 0.2em #4B7B9E", 4) }, - { type: "stroke", color: "#000", width: 0.13 }, - { type: "shadow", property: repeater("0 0 0.07em #65A6D6", 2) }, - ], - }, alfaRomeo: { numberColor: "#ffe9f4", fontFamily: theme.fonts.f1Italic, @@ -349,6 +341,15 @@ export const teamNumberStyles: { [teamId: string]: NumberStyle } = { { type: "stroke", color: "#2b4562", width: 0.03 }, ], }, + alpine: { + numberColor: "#ddffff", + fontFamily: theme.fonts.f1Italic, + rules: [ + { type: "shadow", property: repeater("0 0 0.2em #4B7B9E", 4) }, + { type: "stroke", color: "#000", width: 0.13 }, + { type: "shadow", property: repeater("0 0 0.07em #65A6D6", 2) }, + ], + }, astonMartin: { numberColor: "#f9ffff", fontFamily: theme.fonts.f1Italic, @@ -418,3 +419,80 @@ export const teamNumberStyles: { [teamId: string]: NumberStyle } = { ], }, }; + + +export type TeamFlagStyle = { + backgroundColor: string, + imageSize: Percent, + imagePos: { + x: number, + y: number, + }, + subFlagModifier: { + x: number, + y: number, + scale: number, + }, +}; +export const teamFlagStyles: { [teamId: string]: TeamFlagStyle } = { + alfaRomeo: { + backgroundColor: "#660000", + imageSize: 41, + imagePos: { x: .32, y: .08 }, + subFlagModifier: { x: .99, y: .97, scale: .99 }, + }, + alphaTauri: { + backgroundColor: "#232c3b", + imageSize: 58, + imagePos: { x: .25, y: -.15 }, + subFlagModifier: { x: 1, y: .9, scale: .99 }, + }, + alpine: { + backgroundColor: "black", + imageSize: 51, + imagePos: { x: .23, y: -.12 }, + subFlagModifier: { x: 1.02, y: .98, scale: .98 }, + }, + astonMartin: { + backgroundColor: "#037356", + imageSize: 109, + imagePos: { x: .05, y: -.75 }, + subFlagModifier: { x: 1.05, y: .9, scale: .95 }, + }, + ferrari: { + backgroundColor: "#dc0000", + imageSize: 50, + imagePos: { x: .3, y: .04 }, + subFlagModifier: { x: 1, y: 1, scale: .98 }, + }, + haas: { + backgroundColor: "#f0f0f0", + imageSize: 46, + imagePos: { x: .3, y: -.04 }, + subFlagModifier: { x: 1, y: .98, scale: .98 }, + }, + mclaren: { + backgroundColor: "#545459", + imageSize: 50, + imagePos: { x: .25, y: -.1 }, + subFlagModifier: { x: .98, y: 1.03, scale: 1.03 }, + }, + mercedes: { + backgroundColor: "#1ee0ad", + imageSize: 40, + imagePos: { x: .33, y: .05 }, + subFlagModifier: { x: 1, y: 1, scale: .98 }, + }, + redBull: { + backgroundColor: "#413ae2", + imageSize: 88, + imagePos: { x: .33, y: 0 }, + subFlagModifier: { x: 1.04, y: .2, scale: .92 }, + }, + williams: { + backgroundColor: "#12a0cb", + imageSize: 40, + imagePos: { x: .35, y: .1 }, + subFlagModifier: { x: 1, y: 1, scale: .98 }, + }, +}; diff --git a/src/domain/data/workspaces.ts b/src/domain/data/workspaces.ts index a1132f9..5839e35 100644 --- a/src/domain/data/workspaces.ts +++ b/src/domain/data/workspaces.ts @@ -47,4 +47,23 @@ export const workspaces: WorkspaceObject = { height: 500, }, }, + angledFlagTeam: { + name: "Angled Flag (Team)", + overlayIds: [ + "angled-flag-alfaRomeo.png", + "angled-flag-alphaTauri.png", + "angled-flag-alpine.png", + "angled-flag-astonMartin.png", + "angled-flag-ferrari.png", + "angled-flag-haas.png", + "angled-flag-mclaren.png", + "angled-flag-mercedes.png", + "angled-flag-redBull.png", + "angled-flag-williams.png", + ], + previewWindowDimensions: { + width: 800, + height: 500, + }, + }, }; diff --git a/src/public/images/logos/team/alfaRomeo.svg b/src/public/images/logos/team/alfaRomeo.svg new file mode 100644 index 0000000..55ac7b3 --- /dev/null +++ b/src/public/images/logos/team/alfaRomeo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/public/images/logos/team/alphaTauri.svg b/src/public/images/logos/team/alphaTauri.svg new file mode 100644 index 0000000..c3c222d --- /dev/null +++ b/src/public/images/logos/team/alphaTauri.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/public/images/logos/team/alpine.svg b/src/public/images/logos/team/alpine.svg new file mode 100644 index 0000000..03b94d5 --- /dev/null +++ b/src/public/images/logos/team/alpine.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/public/images/logos/team/astonMartin.svg b/src/public/images/logos/team/astonMartin.svg new file mode 100644 index 0000000..3932789 --- /dev/null +++ b/src/public/images/logos/team/astonMartin.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/public/images/logos/team/ferrari.svg b/src/public/images/logos/team/ferrari.svg new file mode 100644 index 0000000..43e2712 --- /dev/null +++ b/src/public/images/logos/team/ferrari.svg @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/public/images/logos/team/haas.svg b/src/public/images/logos/team/haas.svg new file mode 100644 index 0000000..dc8e819 --- /dev/null +++ b/src/public/images/logos/team/haas.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/public/images/logos/team/mclaren.svg b/src/public/images/logos/team/mclaren.svg new file mode 100644 index 0000000..8b75563 --- /dev/null +++ b/src/public/images/logos/team/mclaren.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/public/images/logos/team/mercedes.svg b/src/public/images/logos/team/mercedes.svg new file mode 100644 index 0000000..a6050cc --- /dev/null +++ b/src/public/images/logos/team/mercedes.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/public/images/logos/team/redbull.svg b/src/public/images/logos/team/redbull.svg new file mode 100644 index 0000000..a2e69ac --- /dev/null +++ b/src/public/images/logos/team/redbull.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/public/images/logos/team/williams.svg b/src/public/images/logos/team/williams.svg new file mode 100644 index 0000000..5aaf1fa --- /dev/null +++ b/src/public/images/logos/team/williams.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/public/images/overlays/angled-flag-alfaRomeo.png b/src/public/images/overlays/angled-flag-alfaRomeo.png new file mode 100644 index 0000000..9b54bcf Binary files /dev/null and b/src/public/images/overlays/angled-flag-alfaRomeo.png differ diff --git a/src/public/images/overlays/angled-flag-alphaTauri.png b/src/public/images/overlays/angled-flag-alphaTauri.png new file mode 100644 index 0000000..518ed0d Binary files /dev/null and b/src/public/images/overlays/angled-flag-alphaTauri.png differ diff --git a/src/public/images/overlays/angled-flag-alpine.png b/src/public/images/overlays/angled-flag-alpine.png new file mode 100644 index 0000000..d69ccd5 Binary files /dev/null and b/src/public/images/overlays/angled-flag-alpine.png differ diff --git a/src/public/images/overlays/angled-flag-astonMartin.png b/src/public/images/overlays/angled-flag-astonMartin.png new file mode 100644 index 0000000..877b56a Binary files /dev/null and b/src/public/images/overlays/angled-flag-astonMartin.png differ diff --git a/src/public/images/overlays/angled-flag-ferrari.png b/src/public/images/overlays/angled-flag-ferrari.png new file mode 100644 index 0000000..f2e40e3 Binary files /dev/null and b/src/public/images/overlays/angled-flag-ferrari.png differ diff --git a/src/public/images/overlays/angled-flag-haas.png b/src/public/images/overlays/angled-flag-haas.png new file mode 100644 index 0000000..8918489 Binary files /dev/null and b/src/public/images/overlays/angled-flag-haas.png differ diff --git a/src/public/images/overlays/angled-flag-mclaren.png b/src/public/images/overlays/angled-flag-mclaren.png new file mode 100644 index 0000000..6d3e5ca Binary files /dev/null and b/src/public/images/overlays/angled-flag-mclaren.png differ diff --git a/src/public/images/overlays/angled-flag-mercedes.png b/src/public/images/overlays/angled-flag-mercedes.png new file mode 100644 index 0000000..f5d1981 Binary files /dev/null and b/src/public/images/overlays/angled-flag-mercedes.png differ diff --git a/src/public/images/overlays/angled-flag-redBull.png b/src/public/images/overlays/angled-flag-redBull.png new file mode 100644 index 0000000..dcca776 Binary files /dev/null and b/src/public/images/overlays/angled-flag-redBull.png differ diff --git a/src/public/images/overlays/angled-flag-williams.png b/src/public/images/overlays/angled-flag-williams.png new file mode 100644 index 0000000..421bfca Binary files /dev/null and b/src/public/images/overlays/angled-flag-williams.png differ diff --git a/src/types/state.d.ts b/src/types/state.d.ts index 157a83a..6842461 100644 --- a/src/types/state.d.ts +++ b/src/types/state.d.ts @@ -32,10 +32,14 @@ export interface WorkspaceProperties { previewWindowDimensions: Dimensions; } export interface PrototypeState { - angledFlag?: { + angledFlagCountry?: { flagA: string; flagB: string; }; + angledFlagTeam?: { + flagA: TeamId; + flagB: TeamId; + }; } // Overlay Tool diff --git a/src/types/style.d.ts b/src/types/style.d.ts index da7c5af..40800d3 100644 --- a/src/types/style.d.ts +++ b/src/types/style.d.ts @@ -2,3 +2,8 @@ * Type to remind you that we're dealing with pixels. */ export type Px = number; + +/** + * Type to remind you that we're dealing with percentages. + */ +export type Percent = number; diff --git a/src/utils/dataLookup.ts b/src/utils/dataLookup.ts index dc48757..469ebeb 100644 --- a/src/utils/dataLookup.ts +++ b/src/utils/dataLookup.ts @@ -1,6 +1,6 @@ import { cloneDeep } from "lodash"; -import { drivers, teams, teamNumberStyles, NumberStyle } from "../domain/data/teams"; -import { Driver, DriverId, Team, TeamId } from "../types/state"; +import { drivers, teams, teamNumberStyles, teamFlagStyles } from "../domain/data/teams"; +import { DriverId, TeamId } from "../types/state"; /** * Prefer getting data from teams.ts through these simple getter functions. @@ -9,20 +9,23 @@ import { Driver, DriverId, Team, TeamId } from "../types/state"; * situation I wouldn't be able to normally */ -export function getDriver(driverId: DriverId): Driver { +export function getDriver(driverId: DriverId) { return drivers[driverId]; } -export function cloneDriver(driverId: DriverId): Driver { +export function cloneDriver(driverId: DriverId) { return cloneDeep(drivers[driverId]); } -export function getTeam(teamId: TeamId): Team { +export function getTeam(teamId: TeamId) { return teams[teamId]; } -export function cloneTeam(teamId: TeamId): Team { +export function cloneTeam(teamId: TeamId) { return cloneDeep(teams[teamId]); } -export function getTeamNumberStyle(teamId: TeamId): NumberStyle { +export function getTeamNumberStyle(teamId: TeamId) { return teamNumberStyles[teamId]; } +export function getTeamFlagStyle(teamId: TeamId) { + return teamFlagStyles[teamId]; +}