home *** CD-ROM | disk | FTP | other *** search
- class ApplicationState
- {
- var m_bMuted;
- var m_eState;
- var AS_APP_STARTED = 0;
- var AS_PRE_GAME = 1;
- var AS_GAME_RUNNING = 2;
- var AS_BETWEEN_ROUNDS = 3;
- var AS_GAME_OVER = 4;
- function ApplicationState()
- {
- this.init();
- }
- function init()
- {
- this.m_bMuted = false;
- this.m_eState = this.AS_APP_STARTED;
- }
- function getState()
- {
- return this.m_eState;
- }
- function setState(eState)
- {
- this.m_eState = eState;
- }
- function isCurrentState(eState)
- {
- return this.m_eState == eState;
- }
- function setPaused(bPaused)
- {
- if(bPaused && !this.isPaused())
- {
- trace("PAUSE");
- LRG.Utils.LRGGameTimer(_global.getGameTimer()).stopClock();
- }
- else if(!bPaused && this.isPaused())
- {
- trace("RESUME");
- LRG.Utils.LRGGameTimer(_global.getGameTimer()).startClock(false);
- }
- }
- function isPaused()
- {
- return !LRG.Utils.LRGGameTimer(_global.getGameTimer()).isRunning();
- }
- function setMuted(bMuted)
- {
- if(this.isMuted() && !bMuted)
- {
- this.m_bMuted = false;
- _global.LRG.LRGMusic.startMusic();
- }
- else if(!this.isMuted() && bMuted)
- {
- _global.LRG.LRGMusic.stopMusic();
- this.m_bMuted = true;
- }
- }
- function isMuted()
- {
- return this.m_bMuted;
- }
- }
-