修复读表引号问题

This commit is contained in:
flswld
2023-03-28 17:19:27 +08:00
parent ddf8700c33
commit a175417ebf
6 changed files with 167 additions and 160 deletions

View File

@@ -6,11 +6,10 @@ import (
// GadgetData 物件配置表
type GadgetData struct {
GadgetId int32 `csv:"ID"`
Type int32 `csv:"类型,omitempty"`
DefaultCamp int32 `csv:"默认阵营,omitempty"`
CanInteract int32 `csv:"能否交互,omitempty"`
Desc string `csv:"描述,omitempty"`
GadgetId int32 `csv:"ID"`
Type int32 `csv:"类型,omitempty"`
DefaultCamp int32 `csv:"默认阵营,omitempty"`
CanInteract int32 `csv:"能否交互,omitempty"`
}
func (g *GameDataConfig) loadGadgetData() {

View File

@@ -243,6 +243,7 @@ func readTable[T any](tablePath string, table *[]*T) {
}
reader := csv.NewReader(bytes.NewBuffer(fileData))
reader.Comma = '\t'
reader.LazyQuotes = true
dec, err := csvutil.NewDecoder(reader)
if err != nil {
info := fmt.Sprintf("create decoder error: %v", err)

View File

@@ -7,12 +7,11 @@ import (
// ItemData 道具分类分表整合配置表
type ItemData struct {
// 公共表头字段
ItemId int32 `csv:"ID"`
Type int32 `csv:"类型,omitempty"`
Weight int32 `csv:"重量,omitempty"`
RankLevel int32 `csv:"排序权重,omitempty"`
GadgetId int32 `csv:"物件ID,omitempty"`
Name string `csv:"数值用类型,omitempty"`
ItemId int32 `csv:"ID"`
Type int32 `csv:"类型,omitempty"`
Weight int32 `csv:"重量,omitempty"`
RankLevel int32 `csv:"排序权重,omitempty"`
GadgetId int32 `csv:"物件ID,omitempty"`
// 材料
MaterialType int32 `csv:"材料类型,omitempty"`
Use1Param1 string `csv:"[使用]1参数1,omitempty"`