type.ts 406 B

1234567891011121314151617181920
  1. import { IType } from "./itype";
  2. export class Type implements IType {
  3. public value: string;
  4. public ord: number;
  5. constructor(value: string, ord: number) {
  6. this.value = value;
  7. this.ord = ord;
  8. }
  9. stringInfo (): object[] {
  10. return [{ type: this.value, dim: 0 }];
  11. }
  12. isCompatible (another: IType): boolean {
  13. return this.value === another.value && this.ord === another.ord;
  14. }
  15. }