package extend.pk.room.state;

import com.game.Global;
import com.game.state.StateBase;

import extend.pk.EXMainServer;
import extend.pk.EXPlayer;
import extend.pk.EXRoom;
import extend.pk.player.state.EXPlayerQiangZhuangState;

public class EXRoomQiangZhuangState  extends StateBase<EXRoom>{

    @Override
    public void enter(EXRoom owner) {
        EXPlayer player = null;
        if (owner.activeSeat == 0) {
            player = (EXPlayer) owner.playerMapBySeat.get(owner.bankerSeat);
        } else {
            player = (EXPlayer) owner.playerMapBySeat.get(owner.activeSeat);
            int nextSeat = player.nextSeat;
            player = (EXPlayer) owner.playerMapBySeat.get(nextSeat);
        }

        EXMainServer.gameCtr.changeActiveSeat(owner, player.seat);

        player.stateMachine.changeState(Global.getState(EXPlayerQiangZhuangState.class));
    }
}
