69 lines
3.1 KiB
TypeScript
69 lines
3.1 KiB
TypeScript
import { LocationGenerator } from "../generators/LocationGenerator";
|
|
import { LootGenerator } from "../generators/LootGenerator";
|
|
import { WeightedRandomHelper } from "../helpers/WeightedRandomHelper";
|
|
import { ILocationBase } from "../models/eft/common/ILocationBase";
|
|
import { ILocationsGenerateAllResponse } from "../models/eft/common/ILocationsSourceDestinationBase";
|
|
import { IAirdropLootResult } from "../models/eft/location/IAirdropLootResult";
|
|
import { AirdropTypeEnum } from "../models/enums/AirdropType";
|
|
import { IAirdropConfig } from "../models/spt/config/IAirdropConfig";
|
|
import { LootRequest } from "../models/spt/services/LootRequest";
|
|
import { ILogger } from "../models/spt/utils/ILogger";
|
|
import { ConfigServer } from "../servers/ConfigServer";
|
|
import { DatabaseServer } from "../servers/DatabaseServer";
|
|
import { LocalisationService } from "../services/LocalisationService";
|
|
import { HashUtil } from "../utils/HashUtil";
|
|
import { JsonUtil } from "../utils/JsonUtil";
|
|
import { TimeUtil } from "../utils/TimeUtil";
|
|
export declare class LocationController {
|
|
protected jsonUtil: JsonUtil;
|
|
protected hashUtil: HashUtil;
|
|
protected weightedRandomHelper: WeightedRandomHelper;
|
|
protected logger: ILogger;
|
|
protected locationGenerator: LocationGenerator;
|
|
protected localisationService: LocalisationService;
|
|
protected lootGenerator: LootGenerator;
|
|
protected databaseServer: DatabaseServer;
|
|
protected timeUtil: TimeUtil;
|
|
protected configServer: ConfigServer;
|
|
protected airdropConfig: IAirdropConfig;
|
|
constructor(jsonUtil: JsonUtil, hashUtil: HashUtil, weightedRandomHelper: WeightedRandomHelper, logger: ILogger, locationGenerator: LocationGenerator, localisationService: LocalisationService, lootGenerator: LootGenerator, databaseServer: DatabaseServer, timeUtil: TimeUtil, configServer: ConfigServer);
|
|
/**
|
|
* Handle client/location/getLocalloot
|
|
* Get a location (map) with generated loot data
|
|
* @param location Map to generate loot for
|
|
* @returns ILocationBase
|
|
*/
|
|
get(location: string): ILocationBase;
|
|
/**
|
|
* Generate a maps base location without loot
|
|
* @param name Map name
|
|
* @returns ILocationBase
|
|
*/
|
|
protected generate(name: string): ILocationBase;
|
|
/**
|
|
* Handle client/locations
|
|
* Get all maps base location properties without loot data
|
|
* @param sessionId Players Id
|
|
* @returns ILocationsGenerateAllResponse
|
|
*/
|
|
generateAll(sessionId: string): ILocationsGenerateAllResponse;
|
|
/**
|
|
* Handle client/location/getAirdropLoot
|
|
* Get loot for an airdop container
|
|
* Generates it randomly based on config/airdrop.json values
|
|
* @returns Array of LootItem objects
|
|
*/
|
|
getAirdropLoot(): IAirdropLootResult;
|
|
/**
|
|
* Randomly pick a type of airdrop loot using weighted values from config
|
|
* @returns airdrop type value
|
|
*/
|
|
protected chooseAirdropType(): AirdropTypeEnum;
|
|
/**
|
|
* Get the configuration for a specific type of airdrop
|
|
* @param airdropType Type of airdrop to get settings for
|
|
* @returns LootRequest
|
|
*/
|
|
protected getAirdropLootConfigByType(airdropType: AirdropTypeEnum): LootRequest;
|
|
}
|