public/js-roguelike-skeleton/src/valid-targets.js
function(){
            if(!this.current){
                return this.getCurrent();
            }

            var index = this.targets.indexOf(this.current);
            if(index === 0){
                index = this.targets.length - 1;
            } else {
                index--;
            }
            this.setCurrent(this.targets[index]);

            return this.current;
        }
function(){
            if(!this.current){
                return this.getCurrent();
            }

            var index = this.targets.indexOf(this.current);
            if(index === 0){
                index = this.targets.length - 1;
            } else {
                index--;
            }
            this.setCurrent(this.targets[index]);

            return this.current;
        }
function ( ) { if ( ! this . current ) { return this . getCurrent ( ) ; } var index = this . targets . indexOf ( this . current ) ; if ( index === 0 ) { index = this . targets . length - 1 ; } else { index -- ; } this . setCurrent ( this . targets [ index ] ) ; return this . current ; }
Sets the object before the currently selected object to be the selected object.
@method prev
@return {Object} The new currently selected object.
Sets the object before the currently selected object to be the selected object .