Server/project/src/callbacks/RepairCallbacks.ts

41 lines
1.6 KiB
TypeScript
Raw Normal View History

2023-03-03 15:23:46 +00:00
import { inject, injectable } from "tsyringe";
import { RepairController } from "@spt-aki/controllers/RepairController";
import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
import { IRepairActionDataRequest } from "@spt-aki/models/eft/repair/IRepairActionDataRequest";
import { ITraderRepairActionDataRequest } from "@spt-aki/models/eft/repair/ITraderRepairActionDataRequest";
2023-03-03 15:23:46 +00:00
@injectable()
export class RepairCallbacks
{
constructor(
@inject("RepairController") protected repairController: RepairController)
{ }
/**
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-07-15 14:49:25 +01: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-07-15 14:49:25 +01: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
}
}