src/scripts/Dungeon.js
//creates direction between 2 rooms and assigns them to them; you can then modify them
creates direction between 2 rooms and assigns them to them; you can then modify them
creates direction between 2 rooms and assigns them to them ; you can then modify them
static createDirection(DirEnum, RoomA, RoomB, options) {
        options = options || {};
        var Label = DngDirection.DirEnumToString(DirEnum);
        var DirAtoB = new DngDirection(DirEnum,Label, "");
        var inverseDir = DngDirection.inverseDirection(DirEnum);
        var backLabel = DngDirection.DirEnumToString(inverseDir);
        var DirBtoA = new DngDirection(inverseDir,backLabel, "");
        DirAtoB.tags=options.tags||[]; 
        DirBtoA.tags=options.tags||[];
        DirBtoA.oneWay=options.onlyAtoB||false;
        DirAtoB.roomA = DirBtoA.roomB = RoomA;
        DirAtoB.roomB = DirBtoA.roomA = RoomB;
        if(RoomA != null) RoomA.setDirection(DirEnum, DirAtoB);
        if(RoomB != null ) RoomB.setDirection(inverseDir, DirBtoA);
    }
static createDirection ( DirEnum , RoomA , RoomB , options ) { options = options || { } ; var Label = DngDirection . DirEnumToString ( DirEnum ) ; var DirAtoB = new DngDirection ( DirEnum , Label , "" ) ; var inverseDir = DngDirection . inverseDirection ( DirEnum ) ; var backLabel = DngDirection . DirEnumToString ( inverseDir ) ; var DirBtoA = new DngDirection ( inverseDir , backLabel , "" ) ; DirAtoB . tags = options . tags || [ ] ; DirBtoA . tags = options . tags || [ ] ; DirBtoA . oneWay = options . onlyAtoB || false ; DirAtoB . roomA = DirBtoA . roomB = RoomA ; DirAtoB . roomB = DirBtoA . roomA = RoomB ; if ( RoomA != null ) RoomA . setDirection ( DirEnum , DirAtoB ) ; if ( RoomB != null ) RoomB . setDirection ( inverseDir , DirBtoA ) ; }
creates direction between 2 rooms and assigns them to them; you can then modify them
creates direction between 2 rooms and assigns them to them ; you can then modify them
//todo should clone?