SpaceNinjaServer/src/types/shipTypes.ts

183 lines
4.0 KiB
TypeScript
Raw Normal View History

2024-12-23 09:15:41 +01:00
import { Types } from "mongoose";
import { IOid } from "@/src/types/commonTypes";
import { IColor } from "@/src/types/inventoryTypes/commonInventoryTypes";
2024-12-19 01:42:10 +01:00
import { ILoadoutClient } from "./saveLoadoutTypes";
2023-06-05 04:16:49 +08:00
export interface IGetShipResponse {
ShipOwnerId: string;
Ship: IShip;
Apartment: IApartment;
2024-12-22 20:32:19 +01:00
TailorShop: ITailorShop;
2024-12-19 01:42:10 +01:00
LoadOutInventory: { LoadOutPresets: ILoadoutClient };
2023-06-05 04:16:49 +08:00
}
export interface IShipAttachments {
HOOD_ORNAMENT: string;
2023-06-05 00:17:01 +02:00
}
export interface IShipInterior {
Colors?: IColor;
ShipAttachments?: IShipAttachments;
SkinFlavourItem?: string;
}
2024-12-16 04:50:51 +01:00
export type TBootLocation = "LISET" | "DRIFTER_CAMP" | "APARTMENT" | "SHOP";
2024-05-06 15:39:27 +02:00
export interface IShip {
2023-06-05 04:16:49 +08:00
Features: string[];
ShipId: IOid;
ShipInterior: IShipInterior;
2024-12-22 20:32:19 +01:00
Rooms: IRoom[];
VignetteFish?: string[];
FavouriteLoadoutId?: IOid;
Wallpaper?: string;
Vignette?: string;
2024-05-06 15:39:27 +02:00
BootLocation?: TBootLocation;
ContentUrlSignature?: string;
2023-06-05 04:16:49 +08:00
}
export interface IShipDatabase {
ItemType: string;
2024-12-23 09:15:41 +01:00
ShipOwnerId: Types.ObjectId;
ShipExteriorColors?: IColor;
AirSupportPower: string;
ShipAttachments?: IShipAttachments;
SkinFlavourItem?: string;
}
2024-12-22 20:32:19 +01:00
export interface IRoom {
2023-06-05 04:16:49 +08:00
Name: string;
MaxCapacity: number;
PlacedDecos?: IPlacedDecosDatabase[];
}
export interface IPlants {
PlantType: string;
EndTime: IOid;
PlotIndex: number;
}
export interface IPlanters {
Name: string;
Plants: IPlants[];
2023-06-05 04:16:49 +08:00
}
export interface IGardening {
Planters?: IPlanters[];
}
export interface IApartment {
Gardening: IGardening;
2024-12-22 20:32:19 +01:00
Rooms: IRoom[];
FavouriteLoadouts: IFavouriteLoadout[];
}
export interface IApartmentDatabase {
Gardening: IGardening;
Rooms: IRoom[];
FavouriteLoadouts: IFavouriteLoadoutDatabase[];
2023-06-05 04:16:49 +08:00
}
export interface IPlacedDecosDatabase {
Type: string;
Pos: [number, number, number];
Rot: [number, number, number];
Scale?: number;
PictureFrameInfo?: IPictureFrameInfo;
_id: Types.ObjectId;
}
export interface IPlacedDecosClient extends Omit<IPlacedDecosDatabase, "_id"> {
id: IOid;
}
export interface ISetShipCustomizationsRequest {
ShipId: string;
Customization: Customization;
IsExterior: boolean;
AirSupportPower?: string;
IsShop?: boolean;
}
export interface Customization {
SkinFlavourItem: string;
Colors: IColor;
ShipAttachments: ShipAttachments;
LevelDecosVisible: boolean;
CustomJson: string;
}
//TODO: check for more attachments
export interface ShipAttachments {
HOOD_ORNAMENT: string;
}
export interface IShipDecorationsRequest {
Type: string;
Pos: [number, number, number];
Rot: [number, number, number];
Room: string;
2024-12-22 20:32:19 +01:00
BootLocation?: TBootLocation;
IsApartment?: boolean;
2024-06-15 17:39:13 +02:00
RemoveId?: string;
MoveId?: string;
OldRoom?: string;
Scale?: number;
}
export interface IShipDecorationsResponse {
2024-06-15 17:39:13 +02:00
DecoId?: string;
Room?: string;
2024-12-22 20:32:19 +01:00
IsApartment?: boolean;
MaxCapacityIncrease?: number;
2024-06-15 17:39:13 +02:00
OldRoom?: string;
NewRoom?: string;
}
export interface ISetPlacedDecoInfoRequest {
DecoType: string;
DecoId: string;
Room: string;
PictureFrameInfo: IPictureFrameInfo;
BootLocation?: string;
ComponentId?: string;
GuildId?: string;
}
export interface IPictureFrameInfo {
Image: string;
Filter: string;
XOffset: number;
YOffset: number;
Scale: number;
InvertX: boolean;
InvertY: boolean;
ColorCorrection: number;
Text: string;
TextScale: number;
TextColorA: number;
TextColorB: number;
TextOrientation: number;
}
2024-12-22 20:32:19 +01:00
export interface IFavouriteLoadout {
Tag: string;
LoadoutId: IOid;
}
export interface IFavouriteLoadoutDatabase {
Tag: string;
LoadoutId: Types.ObjectId;
}
export interface ITailorShopDatabase {
FavouriteLoadouts: IFavouriteLoadoutDatabase[];
Colors?: IColor;
CustomJson: string;
2024-12-22 20:32:19 +01:00
LevelDecosVisible: boolean;
Rooms: IRoom[];
}
export interface ITailorShop extends Omit<ITailorShopDatabase, "FavouriteLoadouts"> {
FavouriteLoadouts: IFavouriteLoadout[];
}