Remove hand written API objects.

This commit is contained in:
Dan Albert
2022-03-06 23:31:43 -08:00
parent 6ee235545f
commit 4b4336391a
22 changed files with 37 additions and 101 deletions

View File

@@ -1,6 +1,6 @@
import { RootState } from "../app/store";
import { gameLoaded, gameUnloaded } from "./actions";
import { ControlPoint } from "./controlpoint";
import { ControlPoint } from "./liberationApi";
import { PayloadAction, createSlice } from "@reduxjs/toolkit";
interface ControlPointsState {

View File

@@ -1,11 +0,0 @@
import { LatLng } from "leaflet";
export interface ControlPoint {
id: number;
name: string;
blue: boolean;
position: LatLng;
mobile: boolean;
destination: LatLng | null;
sidc: string;
}

View File

@@ -4,8 +4,6 @@ import backend from "./backend";
import Combat from "./combat";
import { endCombat, newCombat, updateCombat } from "./combatSlice";
import { updateControlPoint } from "./controlPointsSlice";
import { ControlPoint } from "./controlpoint";
import { Flight } from "./flight";
import {
deselectFlight,
registerFlight,
@@ -19,11 +17,15 @@ import {
deleteFrontLine,
updateFrontLine,
} from "./frontLinesSlice";
import FrontLine from "./frontline";
import reloadGameState from "./gamestate";
import { liberationApi } from "./liberationApi";
import {
liberationApi,
ControlPoint,
Flight,
FrontLine,
Tgo,
} from "./liberationApi";
import { navMeshUpdated } from "./navMeshSlice";
import Tgo from "./tgo";
import { updateTgo } from "./tgosSlice";
import { threatZonesUpdated } from "./threatZonesSlice";
import { LatLng } from "leaflet";

View File

@@ -1,10 +0,0 @@
import { Waypoint } from "./waypoint";
import { LatLng } from "leaflet";
export interface Flight {
id: string;
blue: boolean;
position: LatLng | null;
sidc: string;
waypoints: Waypoint[] | null;
}

View File

@@ -1,6 +1,6 @@
import { RootState } from "../app/store";
import { gameLoaded, gameUnloaded } from "./actions";
import { Flight } from "./flight";
import { Flight } from "./liberationApi";
import { PayloadAction, createSlice } from "@reduxjs/toolkit";
import { LatLng } from "leaflet";

View File

@@ -1,6 +1,6 @@
import { RootState } from "../app/store";
import { gameLoaded, gameUnloaded } from "./actions";
import FrontLine from "./frontline";
import { FrontLine } from "./liberationApi";
import { PayloadAction, createSlice } from "@reduxjs/toolkit";
interface FrontLinesState {

View File

@@ -1,8 +0,0 @@
import { LatLng } from "leaflet";
export interface FrontLine {
id: string;
extents: LatLng[];
}
export default FrontLine;

View File

@@ -1,9 +1,12 @@
import { ControlPoint } from "./controlpoint";
import { Flight } from "./flight";
import FrontLine from "./frontline";
import { NavMeshes, ThreatZoneContainer } from "./liberationApi";
import SupplyRoute from "./supplyroute";
import Tgo from "./tgo";
import {
ControlPoint,
Flight,
FrontLine,
NavMeshes,
SupplyRoute,
Tgo,
ThreatZoneContainer,
} from "./liberationApi";
import { LatLngLiteral } from "leaflet";
export default interface Game {

View File

@@ -1,6 +1,6 @@
import { RootState } from "../app/store";
import { gameLoaded, gameUnloaded } from "./actions";
import SupplyRoute from "./supplyroute";
import { SupplyRoute } from "./liberationApi";
import { createSlice } from "@reduxjs/toolkit";
interface SupplyRoutesState {

View File

@@ -1,11 +0,0 @@
import { LatLng } from "leaflet";
export interface SupplyRoute {
points: LatLng[];
front_active: boolean;
is_sea: boolean;
blue: boolean;
active_transports: string[];
}
export default SupplyRoute;

View File

@@ -1,17 +0,0 @@
import { LatLng } from "leaflet";
export interface Tgo {
id: string;
name: string;
control_point_name: string;
category: string;
blue: boolean;
position: LatLng;
units: string[];
threat_ranges: number[];
detection_ranges: number[];
dead: boolean;
sidc: string;
}
export default Tgo;

View File

@@ -1,6 +1,6 @@
import { RootState } from "../app/store";
import { gameLoaded, gameUnloaded } from "./actions";
import { Tgo } from "./tgo";
import { Tgo } from "./liberationApi";
import { PayloadAction, createSlice } from "@reduxjs/toolkit";
interface TgosState {

View File

@@ -1,12 +0,0 @@
import { LatLng } from "leaflet";
export interface Waypoint {
name: string;
position: LatLng;
altitude_ft: number;
altitude_reference: string;
is_movable: boolean;
should_mark: boolean;
include_in_path: boolean;
timing: string;
}