feat: massive AI generation
This commit is contained in:
@@ -3,6 +3,7 @@ import type { ShipSnapshot } from "../../contractsShips";
|
||||
import type { StationSnapshot } from "../../contractsInfrastructure";
|
||||
import type { FactionSnapshot } from "../../contractsFactions";
|
||||
import type { MarketOrderSnapshot } from "../../contractsEconomy";
|
||||
import type { GeopoliticalStateSnapshot } from "../../contractsGeopolitics";
|
||||
|
||||
export const useGmStore = defineStore("gm", {
|
||||
state: () => ({
|
||||
@@ -10,6 +11,7 @@ export const useGmStore = defineStore("gm", {
|
||||
stations: [] as StationSnapshot[],
|
||||
factions: [] as FactionSnapshot[],
|
||||
marketOrders: [] as MarketOrderSnapshot[],
|
||||
geopolitics: null as GeopoliticalStateSnapshot | null,
|
||||
}),
|
||||
actions: {
|
||||
updateWorld(
|
||||
@@ -17,11 +19,21 @@ export const useGmStore = defineStore("gm", {
|
||||
stations: StationSnapshot[],
|
||||
factions: FactionSnapshot[],
|
||||
marketOrders: MarketOrderSnapshot[],
|
||||
geopolitics: GeopoliticalStateSnapshot | null,
|
||||
) {
|
||||
this.ships = ships;
|
||||
this.stations = stations;
|
||||
this.factions = factions;
|
||||
this.marketOrders = marketOrders;
|
||||
this.geopolitics = geopolitics;
|
||||
},
|
||||
upsertShip(ship: ShipSnapshot) {
|
||||
const index = this.ships.findIndex((candidate) => candidate.id === ship.id);
|
||||
if (index >= 0) {
|
||||
this.ships.splice(index, 1, ship);
|
||||
return;
|
||||
}
|
||||
this.ships.push(ship);
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user