2023-03-03 15:23:46 +00:00
|
|
|
import { inject, injectable } from "tsyringe";
|
2024-05-21 17:59:04 +00:00
|
|
|
import { RepairController } from "@spt/controllers/RepairController";
|
|
|
|
import { IPmcData } from "@spt/models/eft/common/IPmcData";
|
|
|
|
import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse";
|
|
|
|
import { IRepairActionDataRequest } from "@spt/models/eft/repair/IRepairActionDataRequest";
|
|
|
|
import { ITraderRepairActionDataRequest } from "@spt/models/eft/repair/ITraderRepairActionDataRequest";
|
2023-03-03 15:23:46 +00:00
|
|
|
|
|
|
|
@injectable()
|
|
|
|
export class RepairCallbacks
|
|
|
|
{
|
2023-11-15 20:35:05 -05:00
|
|
|
constructor(@inject("RepairController") protected repairController: RepairController)
|
|
|
|
{}
|
2023-03-03 15:23:46 +00:00
|
|
|
|
|
|
|
/**
|
2023-07-15 14:49:25 +01:00
|
|
|
* Handle TraderRepair event
|
2023-03-03 15:23:46 +00:00
|
|
|
* use trader to repair item
|
2023-07-15 14:49:25 +01:00
|
|
|
* @param pmcData Player profile
|
|
|
|
* @param traderRepairRequest Request object
|
|
|
|
* @param sessionID Session id
|
|
|
|
* @returns IItemEventRouterResponse
|
2023-03-03 15:23:46 +00:00
|
|
|
*/
|
2023-11-15 20:35:05 -05:00
|
|
|
public traderRepair(
|
|
|
|
pmcData: IPmcData,
|
|
|
|
traderRepairRequest: ITraderRepairActionDataRequest,
|
|
|
|
sessionID: string,
|
|
|
|
): IItemEventRouterResponse
|
2023-03-03 15:23:46 +00:00
|
|
|
{
|
2023-07-15 14:49:25 +01:00
|
|
|
return this.repairController.traderRepair(sessionID, traderRepairRequest, pmcData);
|
2023-03-03 15:23:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2023-07-15 14:49:25 +01:00
|
|
|
* Handle Repair event
|
2023-03-03 15:23:46 +00:00
|
|
|
* Use repair kit to repair item
|
2023-07-15 14:49:25 +01:00
|
|
|
* @param pmcData Player profile
|
|
|
|
* @param repairRequest Request object
|
|
|
|
* @param sessionID Session id
|
|
|
|
* @returns IItemEventRouterResponse
|
2023-03-03 15:23:46 +00:00
|
|
|
*/
|
2023-11-15 20:35:05 -05:00
|
|
|
public repair(
|
|
|
|
pmcData: IPmcData,
|
|
|
|
repairRequest: IRepairActionDataRequest,
|
|
|
|
sessionID: string,
|
|
|
|
): IItemEventRouterResponse
|
2023-03-03 15:23:46 +00:00
|
|
|
{
|
2023-07-15 14:49:25 +01:00
|
|
|
return this.repairController.repairWithKit(sessionID, repairRequest, pmcData);
|
2023-03-03 15:23:46 +00:00
|
|
|
}
|
2023-11-15 20:35:05 -05:00
|
|
|
}
|