mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-03 04:53:51 +01:00
28 lines
713 B
TypeScript
28 lines
713 B
TypeScript
|
import { Generic_fromJSON, Generic_toJSON, Reviver } from "../../utils/JSONReviver";
|
||
|
|
||
|
interface IParams {
|
||
|
name?: string;
|
||
|
type?: number;
|
||
|
}
|
||
|
|
||
|
export class ActionIdentifier {
|
||
|
name?: string;
|
||
|
type?: number;
|
||
|
|
||
|
constructor(params: IParams = {}) {
|
||
|
if (params.name) this.name = params.name;
|
||
|
if (params.type) this.type = params.type;
|
||
|
}
|
||
|
|
||
|
toJSON(): any {
|
||
|
return Generic_toJSON("ActionIdentifier", this);
|
||
|
}
|
||
|
|
||
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
||
|
static fromJSON(value: any): ActionIdentifier {
|
||
|
return Generic_fromJSON(ActionIdentifier, value.data);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
Reviver.constructors.ActionIdentifier = ActionIdentifier;
|