summaryrefslogtreecommitdiff
path: root/nodejs/model/ship.ts
diff options
context:
space:
mode:
authorJulien Dessaux2024-03-21 17:08:37 +0100
committerJulien Dessaux2024-03-27 15:21:00 +0100
commitd668eac4a63a9aa98c3efff395faa23cfcea1c1b (patch)
tree691e3bb471bcacadb975f581f73e09b84287b4a5 /nodejs/model/ship.ts
parent[javascript] fixed mining loop (diff)
downloadspacetraders-d668eac4a63a9aa98c3efff395faa23cfcea1c1b.tar.gz
spacetraders-d668eac4a63a9aa98c3efff395faa23cfcea1c1b.tar.bz2
spacetraders-d668eac4a63a9aa98c3efff395faa23cfcea1c1b.zip
[node] begin the great typescript rewrite
Diffstat (limited to '')
-rw-r--r--nodejs/model/ship.ts56
1 files changed, 56 insertions, 0 deletions
diff --git a/nodejs/model/ship.ts b/nodejs/model/ship.ts
new file mode 100644
index 0000000..9aaf601
--- /dev/null
+++ b/nodejs/model/ship.ts
@@ -0,0 +1,56 @@
+import { Cargo } from './cargo.ts';
+
+export type Cooldown = {
+ shipSymbol: string;
+ totalSeconds: number;
+ remainingSeconds: number;
+};
+
+export type Consummed = {
+ amount: number;
+ timestamp: Date;
+};
+
+export type Fuel = {
+ capacity: number;
+ consummed: Consummed;
+ current: number;
+};
+
+export type Nav = {
+ flightMode: string;
+ route: Route;
+ status: string;
+ systemSymbol: string;
+ waypointSymbol: string;
+};
+
+export type Route = {
+ arrival: Date;
+ departureTime: Date;
+ destination: RouteEndpoint;
+ origin: RouteEndpoint;
+};
+
+export type RouteEndpoint = {
+ type: string;
+ symbol: string;
+ systemSymbol: string;
+ x: number;
+ y: number;
+};
+
+export type Ship = {
+ cargo: Cargo;
+ cooldown: Cooldown;
+ // crew
+ // engine
+ // frame
+ fuel: Fuel;
+ // modules
+ // mounts
+ nav: Nav;
+ // reactor
+ // registration
+ symbol: string;
+};