上传道具配置表

This commit is contained in:
liwei1dao 2022-07-22 20:22:10 +08:00
parent 5e7876c886
commit 531652ae4b
3 changed files with 16 additions and 16 deletions

View File

@ -1,6 +1,6 @@
[
{
"id": "10001",
"id": 10001,
"name": {
"key": "itemname_10001",
"text": "初级经验精灵"
@ -36,7 +36,7 @@
]
},
{
"id": "10002",
"id": 10002,
"name": {
"key": "itemname_10002",
"text": "石头"
@ -72,7 +72,7 @@
]
},
{
"id": "10003",
"id": 10003,
"name": {
"key": "itemname_10003",
"text": "5星阿宝碎片"
@ -108,7 +108,7 @@
]
},
{
"id": "10004",
"id": 10004,
"name": {
"key": "itemname_10004",
"text": "金币自选箱子"
@ -144,7 +144,7 @@
]
},
{
"id": "10005",
"id": 10005,
"name": {
"key": "itemname_10005",
"text": "随机金币箱子"
@ -180,7 +180,7 @@
]
},
{
"id": "10006",
"id": 10006,
"name": {
"key": "itemname_10006",
"text": "金币箱子"
@ -216,7 +216,7 @@
]
},
{
"id": "10007",
"id": 10007,
"name": {
"key": "itemname_10007",
"text": "2小时金币"
@ -252,7 +252,7 @@
]
},
{
"id": "10008",
"id": 10008,
"name": {
"key": "itemname_10008",
"text": "特殊2小时金币"
@ -288,7 +288,7 @@
]
},
{
"id": "1",
"id": 1,
"name": {
"key": "itemname_1",
"text": "宝箱自选"
@ -324,7 +324,7 @@
]
},
{
"id": "2",
"id": 2,
"name": {
"key": "itemname_2",
"text": "金币"

View File

@ -9,13 +9,13 @@
package cfg
type Game_item struct {
_dataMap map[string]*Game_itemData
_dataMap map[int32]*Game_itemData
_dataList []*Game_itemData
}
func NewGame_item(_buf []map[string]interface{}) (*Game_item, error) {
_dataList := make([]*Game_itemData, 0, len(_buf))
dataMap := make(map[string]*Game_itemData)
dataMap := make(map[int32]*Game_itemData)
for _, _ele_ := range _buf {
if _v, err2 := NewGame_itemData(_ele_); err2 != nil {
return nil, err2
@ -27,7 +27,7 @@ func NewGame_item(_buf []map[string]interface{}) (*Game_item, error) {
return &Game_item{_dataList:_dataList, _dataMap:dataMap}, nil
}
func (table *Game_item) GetDataMap() map[string]*Game_itemData {
func (table *Game_item) GetDataMap() map[int32]*Game_itemData {
return table._dataMap
}
@ -35,7 +35,7 @@ func (table *Game_item) GetDataList() []*Game_itemData {
return table._dataList
}
func (table *Game_item) Get(key string) *Game_itemData {
func (table *Game_item) Get(key int32) *Game_itemData {
return table._dataMap[key]
}

View File

@ -11,7 +11,7 @@ package cfg
import "errors"
type Game_itemData struct {
Id string
Id int32
Name string
Usetype int32
Color int32
@ -41,7 +41,7 @@ func (Game_itemData) GetTypeId() int {
func NewGame_itemData(_buf map[string]interface{}) (_v *Game_itemData, err error) {
_v = &Game_itemData{}
{ var _ok_ bool; if _v.Id, _ok_ = _buf["id"].(string); !_ok_ { err = errors.New("id error"); return } }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["id"].(float64); !_ok_ { err = errors.New("id error"); return }; _v.Id = int32(_tempNum_) }
{var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["name"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Name error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Name, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["usetype"].(float64); !_ok_ { err = errors.New("usetype error"); return }; _v.Usetype = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["color"].(float64); !_ok_ { err = errors.New("color error"); return }; _v.Color = int32(_tempNum_) }