build/ludorum.js
/** If a player moves to win or lose, a final game state is returned. Else the game goes on.
	*/
If a player moves to win or lose, a final game state is returned. Else the game goes on.
If a player moves to win or lose a final game state is returned . Else the game goes on .
function next(moves, haps, update) {
		var activePlayer = this.activePlayer(),
			opponent = this.opponent(activePlayer);
		raiseIf(!moves.hasOwnProperty(activePlayer), 
			'No move for active player ', activePlayer, ' at ', this, '!');
		raiseIf(haps, 'Haps are not required (given ', haps, ')!');
		var winner = { win: activePlayer, lose: opponent, pass: undefined },
			move = moves[activePlayer];
		if (!winner.hasOwnProperty(move)) {
			raise('Invalid move ', moves[activePlayer], ' for ', activePlayer, ' at ', this, '!');
		} else if (update) {
			this.activatePlayers(opponent);
			this.__turns__--;
			this.__winner__ = winner[move];
			return this;
		} else {
			return new this.constructor(this.__turns__ - 1, opponent, winner[move]);
		}
	}
function next ( moves , haps , update ) { var activePlayer = this . activePlayer ( ) , opponent = this . opponent ( activePlayer ) ; raiseIf ( ! moves . hasOwnProperty ( activePlayer ) , 'No move for active player ' , activePlayer , ' at ' , this , '!' ) ; raiseIf ( haps , 'Haps are not required (given ' , haps , ')!' ) ; var winner = { win : activePlayer , lose : opponent , pass : undefined } , move = moves [ activePlayer ] ; if ( ! winner . hasOwnProperty ( move ) ) { raise ( 'Invalid move ' , moves [ activePlayer ] , ' for ' , activePlayer , ' at ' , this , '!' ) ; } else if ( update ) { this . activatePlayers ( opponent ) ; this . __turns__ -- ; this . __winner__ = winner [ move ] ; return this ; } else { return new this . constructor ( this . __turns__ - 1 , opponent , winner [ move ] ) ; } }
If a player moves to win or lose, a final game state is returned.
If a player moves to win or lose a final game state is returned .