aboutsummaryrefslogtreecommitdiff
path: root/src/new_fields/IconField.ts
blob: 62b2cd2541d93bf3bfc970d5ae5eab1e6f90394a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import { Deserializable } from "../client/util/SerializationHelper";
import { serializable, primitive } from "serializr";
import { ObjectField } from "./ObjectField";
import { Copy, ToScriptString } from "./FieldSymbols";

@Deserializable("icon")
export class IconField extends ObjectField {
    @serializable(primitive())
    readonly icon: string;

    constructor(icon: string) {
        super();
        this.icon = icon;
    }

    [Copy]() {
        return new IconField(this.icon);
    }

    [ToScriptString]() {
        return "invalid";
    }
}