aboutsummaryrefslogtreecommitdiff
path: root/src/fields/IconFIeld.ts
blob: a6694cc49e2b5218ba0aae6d0b3c0b74b62c9767 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { BasicField } from "./BasicField";
import { FieldId } from "./Field";
import { Types } from "../server/Message";

export class IconField extends BasicField<string> {
    constructor(data: string = "", id?: FieldId, save: boolean = true) {
        super(data, save, id);
    }

    ToScriptString(): string {
        return `new IconField("${this.Data}")`;
    }

    Copy() {
        return new IconField(this.Data);
    }

    ToJson() {
        return {
            type: Types.Icon,
            data: this.Data,
            id: this.Id
        };
    }
}