diff options
| author | bob <bcz@cs.brown.edu> | 2019-04-19 16:35:45 -0400 |
|---|---|---|
| committer | bob <bcz@cs.brown.edu> | 2019-04-19 16:35:45 -0400 |
| commit | 51bf82d67ad12f8ec2aadf0b3ac36273c811473b (patch) | |
| tree | b578c009635e40be2b370b5349a76ec97234f2b5 /src/fields/IconFIeld.ts | |
| parent | 5ce44593a1edb4de4254f8fc7e323ae1d9f9e896 (diff) | |
| parent | af6feb64510490da8d815f41ceb639d693b9eae3 (diff) | |
Merge branch 'master' into leftbuttondominant
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 |
