diff options
| author | Monika Hedman <monika_hedman@brown.edu> | 2019-04-29 19:55:28 -0400 |
|---|---|---|
| committer | Monika Hedman <monika_hedman@brown.edu> | 2019-04-29 19:55:28 -0400 |
| commit | 53e183fbc116c406ca86889a9fb3e2de61520b60 (patch) | |
| tree | ab979ebabffad7f63f23666aa80025d9bad90872 /src/fields/IconFIeld.ts | |
| parent | 39bb878a32821d2e14110f4158471890234f4769 (diff) | |
| parent | 3da71792a339536118b7af7cfe0529201a45c64e (diff) | |
merge
Diffstat (limited to 'src/fields/IconFIeld.ts')
| -rw-r--r-- | src/fields/IconFIeld.ts | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/fields/IconFIeld.ts b/src/fields/IconFIeld.ts new file mode 100644 index 000000000..a6694cc49 --- /dev/null +++ b/src/fields/IconFIeld.ts @@ -0,0 +1,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 + }; + } +}
\ No newline at end of file |
