function winnerChosen(uint _winningNumber) internal only(State.Pending) {
		state = State.GameOver;

		address _winner = game.tickets[_winningNumber];
		bool _startNew = game.loop;
		GameRules memory _nextRules = game.nextGameRules;

		game.finishedAt = block.timestamp;
		game.winner = _winner;
		game.winningNumber = _winningNumber;
		lastGame = game;

		
		_winner.transfer(game.rules.jackpot);
		payAffiliates();
		owner.transfer(this.balance);

		
		postEvent(_winner, _winningNumber, game.rules.jackpot);

		if (!_startNew) {
			state = State.NotRunning;
			return;
		}

		nextGame(_nextRules);
	}