package startMergeCfg

import (
	"server/gamedata"
)

var CFG_NAME = "StartMerge"

func init() {
	gamedata.InitCfg(CFG_NAME)
}

func GetStartChessList() []int {
	data, err := gamedata.GetData(CFG_NAME)
	if err != nil {
		return nil
	}
	var ChessList []int
	for _, v := range data {
		v1 := v.(map[string]interface{})
		ChessList = append(ChessList, gamedata.GetIntValue(v1, "MergeId"))
	}
	return ChessList
}

func GetInitChessList() []int {
	data, err := gamedata.GetData(CFG_NAME)
	if err != nil {
		return nil
	}
	var ChessList []int
	for _, v := range data {
		if gamedata.GetIntValue(v, "Lock") == 0 {
			ChessList = append(ChessList, gamedata.GetIntValue(v, "MergeId"))
		}
	}
	return ChessList
}
