import { assert } from "../util" ; import { EventDispatcher } from "./EventDispatcher" ; import { Directory } from "./Directory" ; export class Project extends Directory { fiddleName : string ; fiddleEditable : boolean ; onDidChangeStatus = new EventDispatcher ( "Status Change" ) ; onChange = new EventDispatcher ( "Project Change" ) ; onDirtyFileUsed = new EventDispatcher ( "Dirty File Used" ) ; constructor ( ) { super ( "Project" ) ; } private status : string [ ] = [ "Idle" ] ; hasStatus ( ) { return this . status . length > 1 ; } getStatus ( ) { if ( this . hasStatus ( ) ) { return this . status [ this . status . length - 1 ] ; } return "" ; } pushStatus ( status ) { this . status . push ( status ) ; this . onDidChangeStatus . dispatch ( ) ; } popStatus ( ) { assert ( this . status . length ) ; this . status . pop ( ) ; this . onDidChangeStatus . dispatch ( ) ; } }