mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-28 03:47:03 +02:00
27 lines
619 B
TypeScript
27 lines
619 B
TypeScript
import { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from "../utils/JSONReviver";
|
|
|
|
interface IParams {
|
|
name?: string;
|
|
type?: number;
|
|
}
|
|
|
|
export class ActionIdentifier {
|
|
name = "";
|
|
type = -1;
|
|
|
|
constructor(params: IParams = {}) {
|
|
if (params.name) this.name = params.name;
|
|
if (params.type) this.type = params.type;
|
|
}
|
|
|
|
toJSON(): IReviverValue {
|
|
return Generic_toJSON("ActionIdentifier", this);
|
|
}
|
|
|
|
static fromJSON(value: IReviverValue): ActionIdentifier {
|
|
return Generic_fromJSON(ActionIdentifier, value.data);
|
|
}
|
|
}
|
|
|
|
Reviver.constructors.ActionIdentifier = ActionIdentifier;
|