package taurus.util;

import com.taurus.core.entity.ITArray;
import com.taurus.core.entity.ITObject;
import com.taurus.core.entity.TObject;

import java.util.List;


public class CardGroup {
    /**
     * 当前type
     */
    public CardConfig config;

    public int min_card;
    /**
     * 长度
     */
    public int len = 1;

    public List<CardObj> card_list;

    public ITArray card_list_mp;

    public ITObject toObject(boolean card_size) {
        ITObject obj = TObject.newInstance();
//        if (card_size) {
            obj.putInt("card_size", card_list.size());
//        } else {
            obj.putTArray("card_list", card_list_mp);
//        }

        obj.putInt("type", config.type);
        obj.putInt("min_card", min_card);
        obj.putInt("len", len);
        System.out.println("出牌牌型具体" + obj);
        return obj;
    }

    public String toString() {
        return "{type:" + config + " min_card:" + min_card + " len:" + len + " list:" + card_list + "}";
    }

}
