blob: 5f2cd1db8794c5fe3dea24577442e4c0f7c5fe0e (
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 { FIELD_ID } from "./Field";
import { Types } from "../server/Message";
export class TextField extends BasicField<string> {
constructor(data: string = "", id: FIELD_ID = undefined) {
super(data, id);
}
ToScriptString(): string {
return `new TextField("${this.Data}")`;
}
Copy() {
return new TextField(this.Data);
}
ToJson(): { type: Types, data: string, id: string } {
return {
type: Types.Text,
data: this.Data,
id: this.Id as string
}
}
}
|