package extend.mj.player.rule;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.taurus.core.entity.TArray;

import extend.mj.EXPlayer;
import extend.mj.RuleWeight;
import extend.mj.WinCardType;
import extend.mj.tip.IRuleBase;
import extend.mj.tip.Tip;
import extend.mj.uitl.Paixing;

/**
 * ���ֺ����
 * 
 */
public class RuleQSWin implements IRuleBase{

	@Override
	public boolean condition(EXPlayer player) {
		List<Integer> cardList = player.cardInhand;
		Map<Integer, WinCardType> map = new HashMap<>();
		Paixing.qs_check(map, cardList,player.room.config, player.getRoom().difen_score);
		boolean result = map.size()>0;

		if (result) {
			Tip tip = new Tip(0,new TArray(), 0,this, RuleWeight.TYPE_QSWIN);
			tip.group_type = RuleWeight.GROUO_QSWIN;
			tip.winMap = map;
			player.tipMgr.addTip(tip);
			player.getRoom().qsWinCount ++;
		}
		return result;
	}

	@Override
	public void action(EXPlayer player, Tip tip) {
		
		
	}

}
