package hunan;

import com.game.Util;
import com.taurus.core.entity.ITArray;
import com.taurus.core.entity.ITObject;
import com.taurus.core.entity.TObject;
import com.taurus.core.plugin.database.DataBase;
import com.taurus.core.util.Logger;
import com.taurus.core.util.StringUtil;
import taurus.client.Message;
import taurus.client.TaurusClient;
import taurus.util.*;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


public class HuNanChangShaNew {

    private static final Logger log = Logger.getLogger(DoTest.class);
    //湖南红中麻将手牌
    private List<Integer> changShaCardInhand = new ArrayList<>();


    /**
     * 初始化手牌协议 811
     * @param command
     * @param message
     * @param client
     * @return
     */
    public String cardInHead(String command, Message message, TaurusClient client) {
        if (command.equalsIgnoreCase("811")) {
            log.info("cardInhand changsha new");
            ITObject param = message.param;
            if (param == null) {
                return null;
            }
//            {bank_seat=1, laiziCard=0, laiziCard2=0, laiziCard2Before=0, jing=0, laiziCardBefore=0, card_list=[101, 103, 104, 201, 204, 207, 208, 209, 307, 309, 501, 502, 503]}
            ITArray cardList = param.getTArray("card_list");
            for (int i = 0; i < cardList.size(); i++) {
                changShaCardInhand.add(cardList.getInt(i));
            }
        }
        return null;
    }

    public void drawCard(String command, Message message,ITObject param) {

    }

}
