ISSUE-054 - Merged state.d.ts and state.ts for simplicity's sake.
Added new CarNotice and TyreCompound enums and data pieces.
This commit is contained in:
1 parent
2ad7fdd24c
commit
54878b8cb2
3 files changed
+458
-287
No files matched your search
@@ -1,8 +1,14 @@
|
||||
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
|
||||
|
||||
import { CourseFlag, CarStatus, RootState } from "../../types/state";
|
||||
import { CourseFlag, CarStatus, RootState, Tyre, TyreCompound, CarNotice } from "../../types/state";
|
||||
import { cloneDriver } from "../../utils/dataLookup";
|
||||
|
||||
const DEFAULT_TYRE: Tyre = {
|
||||
compound: TyreCompound.Medium,
|
||||
age: 0,
|
||||
new: true,
|
||||
};
|
||||
|
||||
const initialState: RootState["event"] = {
|
||||
trackName: "Melbourne",
|
||||
courseStatus: {
|
||||
@@ -19,26 +25,166 @@ const initialState: RootState["event"] = {
|
||||
lapCount: 10,
|
||||
},
|
||||
grid: [
|
||||
{ position: 1, status: CarStatus.Normal, distance: 2000 * 2, driver: cloneDriver("verstappen") },
|
||||
{ position: 2, status: CarStatus.Normal, distance: 1900 * 2, driver: cloneDriver("hamilton") },
|
||||
{ position: 3, status: CarStatus.Normal, distance: 1800 * 2, driver: cloneDriver("bottas") },
|
||||
{ position: 4, status: CarStatus.Retired, distance: 1700 * 2, driver: cloneDriver("perez") },
|
||||
{ position: 5, status: CarStatus.Normal, distance: 1600 * 2, driver: cloneDriver("sainz") },
|
||||
{ position: 6, status: CarStatus.Retired, distance: 1500 * 2, driver: cloneDriver("norris") },
|
||||
{ position: 7, status: CarStatus.Normal, distance: 1400 * 2, driver: cloneDriver("leclerc") },
|
||||
{ position: 8, status: CarStatus.Normal, distance: 1300 * 2, driver: cloneDriver("ricciardo") },
|
||||
{ position: 9, status: CarStatus.Normal, distance: 1200 * 2, driver: cloneDriver("gasly") },
|
||||
{ position: 10, status: CarStatus.Normal, distance: 1100 * 2, driver: cloneDriver("alonso") },
|
||||
{ position: 11, status: CarStatus.Normal, distance: 1000 * 2, driver: cloneDriver("ocon") },
|
||||
{ position: 12, status: CarStatus.Normal, distance: 900 * 2, driver: cloneDriver("vettel") },
|
||||
{ position: 13, status: CarStatus.Normal, distance: 800 * 2, driver: cloneDriver("stroll") },
|
||||
{ position: 14, status: CarStatus.Normal, distance: 700 * 2, driver: cloneDriver("tsunoda") },
|
||||
{ position: 15, status: CarStatus.Normal, distance: 600 * 2, driver: cloneDriver("russell") },
|
||||
{ position: 16, status: CarStatus.Normal, distance: 500 * 2, driver: cloneDriver("raikkonen") },
|
||||
{ position: 17, status: CarStatus.Normal, distance: 400 * 2, driver: cloneDriver("latifi") },
|
||||
{ position: 18, status: CarStatus.Normal, distance: 300 * 2, driver: cloneDriver("giovinazzi") },
|
||||
{ position: 19, status: CarStatus.Normal, distance: 200 * 2, driver: cloneDriver("schumacher") },
|
||||
{ position: 20, status: CarStatus.Normal, distance: 1, driver: cloneDriver("mazepin") },
|
||||
{
|
||||
position: 1,
|
||||
status: CarStatus.Normal,
|
||||
tyre: DEFAULT_TYRE,
|
||||
notices: [],
|
||||
distance: 2000 * 2,
|
||||
driver: cloneDriver("verstappen"),
|
||||
},
|
||||
{
|
||||
position: 2,
|
||||
status: CarStatus.Normal,
|
||||
tyre: DEFAULT_TYRE,
|
||||
notices: [CarNotice.FastestLap],
|
||||
distance: 1900 * 2,
|
||||
driver: cloneDriver("hamilton"),
|
||||
},
|
||||
{
|
||||
position: 3,
|
||||
status: CarStatus.Normal,
|
||||
tyre: DEFAULT_TYRE,
|
||||
notices: [],
|
||||
distance: 1800 * 2,
|
||||
driver: cloneDriver("bottas"),
|
||||
},
|
||||
{
|
||||
position: 4,
|
||||
status: CarStatus.Retired,
|
||||
tyre: DEFAULT_TYRE,
|
||||
notices: [],
|
||||
distance: 1700 * 2,
|
||||
driver: cloneDriver("perez"),
|
||||
},
|
||||
{
|
||||
position: 5,
|
||||
status: CarStatus.Normal,
|
||||
tyre: DEFAULT_TYRE,
|
||||
notices: [],
|
||||
distance: 1600 * 2,
|
||||
driver: cloneDriver("sainz"),
|
||||
},
|
||||
{
|
||||
position: 6,
|
||||
status: CarStatus.Retired,
|
||||
tyre: DEFAULT_TYRE,
|
||||
notices: [],
|
||||
distance: 1500 * 2,
|
||||
driver: cloneDriver("norris"),
|
||||
},
|
||||
{
|
||||
position: 7,
|
||||
status: CarStatus.Normal,
|
||||
tyre: DEFAULT_TYRE,
|
||||
notices: [],
|
||||
distance: 1400 * 2,
|
||||
driver: cloneDriver("leclerc"),
|
||||
},
|
||||
{
|
||||
position: 8,
|
||||
status: CarStatus.Normal,
|
||||
tyre: DEFAULT_TYRE,
|
||||
notices: [],
|
||||
distance: 1300 * 2,
|
||||
driver: cloneDriver("ricciardo"),
|
||||
},
|
||||
{
|
||||
position: 9,
|
||||
status: CarStatus.Normal,
|
||||
tyre: DEFAULT_TYRE,
|
||||
notices: [],
|
||||
distance: 1200 * 2,
|
||||
driver: cloneDriver("gasly"),
|
||||
},
|
||||
{
|
||||
position: 10,
|
||||
status: CarStatus.Normal,
|
||||
tyre: DEFAULT_TYRE,
|
||||
notices: [],
|
||||
distance: 1100 * 2,
|
||||
driver: cloneDriver("alonso"),
|
||||
},
|
||||
{
|
||||
position: 11,
|
||||
status: CarStatus.Normal,
|
||||
tyre: DEFAULT_TYRE,
|
||||
notices: [],
|
||||
distance: 1000 * 2,
|
||||
driver: cloneDriver("ocon"),
|
||||
},
|
||||
{
|
||||
position: 12,
|
||||
status: CarStatus.Normal,
|
||||
tyre: DEFAULT_TYRE,
|
||||
notices: [],
|
||||
distance: 900 * 2,
|
||||
driver: cloneDriver("vettel"),
|
||||
},
|
||||
{
|
||||
position: 13,
|
||||
status: CarStatus.Normal,
|
||||
tyre: DEFAULT_TYRE,
|
||||
notices: [],
|
||||
distance: 800 * 2,
|
||||
driver: cloneDriver("stroll"),
|
||||
},
|
||||
{
|
||||
position: 14,
|
||||
status: CarStatus.Normal,
|
||||
tyre: DEFAULT_TYRE,
|
||||
notices: [],
|
||||
distance: 700 * 2,
|
||||
driver: cloneDriver("tsunoda"),
|
||||
},
|
||||
{
|
||||
position: 15,
|
||||
status: CarStatus.Normal,
|
||||
tyre: DEFAULT_TYRE,
|
||||
notices: [],
|
||||
distance: 600 * 2,
|
||||
driver: cloneDriver("russell"),
|
||||
},
|
||||
{
|
||||
position: 16,
|
||||
status: CarStatus.Normal,
|
||||
tyre: DEFAULT_TYRE,
|
||||
notices: [],
|
||||
distance: 500 * 2,
|
||||
driver: cloneDriver("raikkonen"),
|
||||
},
|
||||
{
|
||||
position: 17,
|
||||
status: CarStatus.Normal,
|
||||
tyre: DEFAULT_TYRE,
|
||||
notices: [],
|
||||
distance: 400 * 2,
|
||||
driver: cloneDriver("latifi"),
|
||||
},
|
||||
{
|
||||
position: 18,
|
||||
status: CarStatus.Normal,
|
||||
tyre: DEFAULT_TYRE,
|
||||
notices: [],
|
||||
distance: 300 * 2,
|
||||
driver: cloneDriver("giovinazzi"),
|
||||
},
|
||||
{
|
||||
position: 19,
|
||||
status: CarStatus.Normal,
|
||||
tyre: DEFAULT_TYRE,
|
||||
notices: [],
|
||||
distance: 200 * 2,
|
||||
driver: cloneDriver("schumacher"),
|
||||
},
|
||||
{
|
||||
position: 20,
|
||||
status: CarStatus.Normal,
|
||||
tyre: DEFAULT_TYRE,
|
||||
notices: [],
|
||||
distance: 1,
|
||||
driver: cloneDriver("mazepin"),
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user