namespace NT { /**
     * Represents a text file asset.
     */ export class TextAsset implements IAsset { /** The name of this asset. */ public readonly Name : string ; /** The content of this asset. */ public readonly Data : string ; param name param data public constructor ( name , data ) { this . Name = name ; this . Data = data ; } } /**
     * The loader for a text asset.
     */ export class TextAssetLoader implements IAssetLoader { /**
         * The list of supported file extensions.
         */ public get supportedExtensions ( ) : string [ ] { return [ "txt" ] ; } param assetName public LoadAsset ( assetName ) { let request = new XMLHttpRequest ( ) ; request . open ( "GET" , assetName ) ; request . addEventListener ( "load" , this . onTextLoaded . bind ( this , assetName , request ) ) ; request . send ( ) ; } param assetName param request private onTextLoaded ( assetName , request ) { console . debug ( "onTextLoaded: assetName/request" , assetName , request ) ; if ( request . readyState === request . DONE ) { let asset = new TextAsset ( assetName , request . responseText ) ; AssetManager . onAssetLoaded ( asset ) ; } } } }