import { CommandInterface } from '../Commands' ; import * as Constants from '../Constants' ; import { Variables } from './Variables' ; import { Variable } from './Variable' ; export class UnknownType extends Variable { private _typename : string = 'UnknownType' ; private _extendedTypename : string ; private _size : Array < number > ; constructor ( name = '' , value = '' , type = '' , size = [ ] ) { super ( ) ; this . _name = name ; this . _value = value ; this . _extendedTypename = `${ this . _typename }: ${ type } ${ size . join ( Constants . SIZE_SEPARATOR ) }` ; this . _typename = type ; this . _size = size ; } public typename ( ) { return this . _typename ; } public extendedTypename ( ) { return this . _extendedTypename ; } public loads ( type ) { return type . length !== 0 ; } public size ( ) { return this . _size ; } public createConcreteType ( name , value , type , size ) { return new UnknownType ( name , value , type , size ) ; } public loadNew ( name , type , runtime , callback ) { Variables . getSize ( name , runtime , ( size ) => { const loadable = Variables . loadable ( size ) ; const buildWith = ( value ) => { const v = this . createConcreteType ( name , value , type , size ) ; callback ( v ) ; } ; if ( loadable ) { Variables . getValue ( name , runtime , buildWith ) ; } else { buildWith ( size . join ( Constants . SIZE_SEPARATOR ) ) ; } } ) ; } public listChildren ( runtime , count , start , callback ) { } }