ISSUE-032 - Defined a great number of new state types for use with the race event's state, the broadcast director's controls, and the broadcast graphics states.
Taking a second to make a commit to save my progress so far.
This commit is contained in:
1 parent
ef0b58e98b
commit
5d009a3d70
12 files changed
+254
-21
No files matched your search
Vendored
+90
-15
@@ -1,7 +1,12 @@
|
||||
import { Milliseconds, Optional } from "./util";
|
||||
|
||||
export interface RootState {
|
||||
pageDimensions: PageDimensions;
|
||||
workspace: Workspace;
|
||||
overlayTool: OverlayTool;
|
||||
event: Event,
|
||||
broadcastDirector: BroadcastDirector;
|
||||
broadcastGraphics: BroadcastGraphics;
|
||||
}
|
||||
|
||||
// Page Dimensions
|
||||
@@ -42,14 +47,54 @@ export interface OverlayItem {
|
||||
opacity: number;
|
||||
}
|
||||
|
||||
// Race State.
|
||||
// Event State
|
||||
export interface Event {
|
||||
trackName: string;
|
||||
courseStatus: CourseStatus;
|
||||
mode: EventMode;
|
||||
progress: EventProgress;
|
||||
grid: Grid;
|
||||
}
|
||||
export interface EventProgress {
|
||||
startTime: Milliseconds;
|
||||
timeLimit: Milliseconds;
|
||||
currentLap: number;
|
||||
lapCount: number;
|
||||
}
|
||||
export type EventMode =
|
||||
| "race"
|
||||
| "sprint"
|
||||
| "p1"
|
||||
| "p2"
|
||||
| "p3"
|
||||
| "q1"
|
||||
| "q2"
|
||||
| "q3";
|
||||
export interface CourseStatus {
|
||||
courseFlag: CourseFlags;
|
||||
sectorFlags: Array<CourseFlag>;
|
||||
safetyCar: SafetyCarStatus;
|
||||
virtualSafetyCar: VirtualSafetyCarStatus;
|
||||
}
|
||||
export type CourseFlag =
|
||||
| "green"
|
||||
| "yellow"
|
||||
| "doubleYellow"
|
||||
| "chequered"
|
||||
| "red"
|
||||
| "white"
|
||||
| "redYellow";
|
||||
export type SafetyCarStatus = "clear" | "starting" | "out" | "ending";
|
||||
export type VirtualSafetyCarStatus = "clear" | "out" | "ending";
|
||||
export type Grid = Array<Car>; // Grid order does not change.
|
||||
export interface Car {
|
||||
position: number;
|
||||
driver: Driver;
|
||||
// status: ???;
|
||||
// status: ???; // retired
|
||||
// flags: ???, // blue, red, meatball, black/white, black
|
||||
// notices: ???; // Penalties, warnings, investigations, blue flags, etc
|
||||
// distance: number;
|
||||
}
|
||||
export type Grid = Array<Car>;
|
||||
export interface Driver {
|
||||
id: DriverId;
|
||||
firstName: string;
|
||||
@@ -126,6 +171,11 @@ export type TeamFullName =
|
||||
| "Red Bull Racing"
|
||||
| "Williams Racing";
|
||||
|
||||
// Broadcast Director
|
||||
export interface BroadcastDirector {
|
||||
selectedCars: Array<Car>;
|
||||
}
|
||||
|
||||
// Broadcast Graphics
|
||||
export interface BGRelativePos {
|
||||
top?: string;
|
||||
@@ -133,34 +183,59 @@ export interface BGRelativePos {
|
||||
bottom?: string;
|
||||
left?: string;
|
||||
}
|
||||
export interface BGBaseState {
|
||||
relativePos: BGRelativePos;
|
||||
openState: OpenState;
|
||||
}
|
||||
/**
|
||||
* -1 closing, 0 closed, 1 open, 2... different states
|
||||
*/
|
||||
export type OpenState = number;
|
||||
|
||||
export interface BroadcastGraphics {
|
||||
// timingBoard: BGTimingBoard;
|
||||
// statusIndicator: BGStatusIndicator;
|
||||
// indicators: BGIndicators
|
||||
chyrons: BGChyrons;
|
||||
chyrons: Optional<BGChyrons>;
|
||||
// gems: BGGems
|
||||
// toasts: BGToasts;
|
||||
}
|
||||
|
||||
export interface BGChyrons {
|
||||
primary: BGChyron;
|
||||
secondary: BGChyron;
|
||||
// sponsorGem: BGSponsorGem;
|
||||
}
|
||||
|
||||
// Chyrons
|
||||
export type FlagMode = "country" | "team";
|
||||
export type BGChyronMode =
|
||||
| "driver-basic-small"
|
||||
| "driver-basic-medium"
|
||||
| "driver-basic-large";
|
||||
export interface BGChyron extends BGRelativePos {
|
||||
export interface BGChyron extends BGBaseState {
|
||||
mode: BGChyronMode;
|
||||
cars: Array<Car>;
|
||||
car: Car;
|
||||
flagMode: FlagMode;
|
||||
showPosFlag: boolean;
|
||||
showDriverNumber: boolean;
|
||||
dimensions: Dimensions;
|
||||
props?: unknown;
|
||||
}
|
||||
export interface BGChyrons {
|
||||
primary: BGChyron;
|
||||
secondary: Optional<BGChyron>;
|
||||
// sponsorGem: BGSponsorGem;
|
||||
}
|
||||
export interface BGChyronMedium extends BGChyron {
|
||||
mode: "driver-basic-medium";
|
||||
flag: FlagMode;
|
||||
showPosFlag: boolean;
|
||||
showDriverNumber: boolean;
|
||||
dimensions: {
|
||||
width: 582;
|
||||
height: 72;
|
||||
}
|
||||
props: {
|
||||
showPortrait: boolean;
|
||||
}
|
||||
}
|
||||
export interface BGChyronLarge extends BGChyron {
|
||||
mode: "driver-basic-large";
|
||||
dimensions: {
|
||||
width: 638;
|
||||
height: 98;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user