2021-08-16 06:11:52 +02:00
|
|
|
import { IActionIdentifier } from "./IActionIdentifier";
|
2021-08-16 04:35:43 +02:00
|
|
|
import { Generic_fromJSON, Generic_toJSON, Reviver } from "../../utils/JSONReviver";
|
|
|
|
|
|
|
|
interface IParams {
|
|
|
|
name?: string;
|
|
|
|
type?: number;
|
|
|
|
}
|
|
|
|
|
2021-08-16 06:11:52 +02:00
|
|
|
export class ActionIdentifier implements IActionIdentifier {
|
2021-08-19 07:45:26 +02:00
|
|
|
name = "";
|
|
|
|
type = -1;
|
2021-08-16 04:35:43 +02:00
|
|
|
|
|
|
|
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;
|