package extend.mj.player.rulestate;

import com.game.state.StateBase;
import extend.mj.*;

/**
 * ��Ӧ���ƴ���״̬
 * 
 *
 * 2017��8��30��
 * PROtherWinState.java
 */
public class PROtherWinState extends StateBase<EXPlayer>{

	@Override
	public void enter(EXPlayer owner) {
		EXRoom room = (EXRoom) owner.room;
		owner.winer = 1;
		EXPlayer activePlayer =  (EXPlayer)room.playerMapBySeat.get(owner.room.activeSeat);

		room.addScore(owner,activePlayer, owner.hu_score, EXScore.WIN);

		room.addPiaoNiaoScore(owner, activePlayer);
		activePlayer.settleLog.add(Config.SETTLE_DIAN_PAO);
		activePlayer.winer = 2;
		activePlayer.last_winer = 2;
		
		owner.settleLog.add(Config.SETTLE_JIE_PAO);
		EXMainServer.gameCtr.winEvent(owner,activePlayer.seat,room.activeCard);

		if (room.lastBankerSeat == 0)
		{
			room.lastBankerSeat = room.bankerSeat;
		}
		room.bankerSeat = owner.seat;
		room.winCount += 1;

		owner.winCard = room.activeCard;

		room.winCallback( owner ,owner.winCard);
	}

}
