src/scripts/Dungeon.js
// this is currently not used because it wouldnt work if there is a trigger deeper inside a function that would require to leave and return to that function
this is currently not used because it wouldnt work if there is a trigger deeper inside a function that would require to leave and return to that function
this is currently not used because it wouldnt work if there is a trigger deeper inside a function that would require to leave and return to that function
moveIterator() {
        var dir;
        var _it=0;
        var _dirs = this.fromRoom.getDirections();
        for(var i=0;i<_dirs.length;i++) {
            var element = _dirs[i];
            _it = _it +1; 
            if (element == null ) continue;
            if (_it <= this.it) continue;
            this.it = _it;
            dir = element;
            if (dir.roomA == this.fromRoom && dir.roomB==this) {
                if (dir.onExit()){
                    return;
                }
            }
        }
        _dirs = this.getDirections();
        for(var i=0;i<_dirs.length;i++) {
            var element1 = _dirs[i];
            _it = _it +1; 
            if (element1 == null) continue;
            if (_it <= this.it) continue;
            this.it = _it;
            dir = element1;
            if (dir.roomA==this && dir.roomB == this.fromRoom) {
                if (dir.onEnter()) {
                    return;
                }
            }
        }
        _it = _it +1; 
        if (_it > this.it && this.onEnter()) {
            this.it = _it;
            return;
        }
        _it = _it +1; 
        if (_it > this.it && this.floor.dungeon.onEnterRoom!==null && this.floor.dungeon.onEnterRoom(this)) { 
        } 
        this.floor.dungeon.resumeRoom();
    }
moveIterator ( ) { var dir ; var _it = 0 ; var _dirs = this . fromRoom . getDirections ( ) ; for ( var i = 0 ; i < _dirs . length ; i ++ ) { var element = _dirs [ i ] ; _it = _it + 1 ; if ( element == null ) continue ; if ( _it <= this . it ) continue ; this . it = _it ; dir = element ; if ( dir . roomA == this . fromRoom && dir . roomB == this ) { if ( dir . onExit ( ) ) { return ; } } } _dirs = this . getDirections ( ) ; for ( var i = 0 ; i < _dirs . length ; i ++ ) { var element1 = _dirs [ i ] ; _it = _it + 1 ; if ( element1 == null ) continue ; if ( _it <= this . it ) continue ; this . it = _it ; dir = element1 ; if ( dir . roomA == this && dir . roomB == this . fromRoom ) { if ( dir . onEnter ( ) ) { return ; } } } _it = _it + 1 ; if ( _it > this . it && this . onEnter ( ) ) { this . it = _it ; return ; } _it = _it + 1 ; if ( _it > this . it && this . floor . dungeon . onEnterRoom !== null && this . floor . dungeon . onEnterRoom ( this ) ) { } this . floor . dungeon . resumeRoom ( ) ; }
this is currently not used because it wouldnt work if there is a trigger deeper inside a function that would require to leave and return to that function
this is currently not used because it wouldnt work if there is a trigger deeper inside a function that would require to leave and return to that function
//DngDirection; //call Exit function from previous room // as DngDirection; //call Entry function of this room //todo if there are multiple events on enter? /*this.it = _it;
            return;*/ //this.floor.dungeon.inRoomedDungeonResume = this.floor.dungeon.resumeRoomMenu;//this.origResumeFct; //this.floor.dungeon.inRoomedDungeonResume();