From fd4b80502c9429c11692e3b5e5cc10624f4999d9 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Tue, 6 Sep 2022 19:12:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E9=85=8D=E7=BD=AE=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sys/configure/structs/Game.RdtaskSideData.go | 2 + sys/configure/structs/Game.Stroy.go | 42 +++++++ sys/configure/structs/Game.StroyData.go | 122 +++++++++++++++++++ sys/configure/structs/Tables.go | 7 ++ 4 files changed, 173 insertions(+) create mode 100644 sys/configure/structs/Game.Stroy.go create mode 100644 sys/configure/structs/Game.StroyData.go diff --git a/sys/configure/structs/Game.RdtaskSideData.go b/sys/configure/structs/Game.RdtaskSideData.go index 45f676419..4e1057366 100644 --- a/sys/configure/structs/Game.RdtaskSideData.go +++ b/sys/configure/structs/Game.RdtaskSideData.go @@ -13,6 +13,7 @@ import "errors" type GameRdtaskSideData struct { Id int32 ObjType int32 + Location string Modelaction string Modelstate int32 Point string @@ -34,6 +35,7 @@ func (*GameRdtaskSideData) GetTypeId() int32 { func (_v *GameRdtaskSideData)Deserialize(_buf map[string]interface{}) (err error) { { 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 _tempNum_ float64; if _tempNum_, _ok_ = _buf["objType"].(float64); !_ok_ { err = errors.New("objType error"); return }; _v.ObjType = int32(_tempNum_) } + { var _ok_ bool; if _v.Location, _ok_ = _buf["location"].(string); !_ok_ { err = errors.New("location error"); return } } { var _ok_ bool; if _v.Modelaction, _ok_ = _buf["modelaction"].(string); !_ok_ { err = errors.New("modelaction error"); return } } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["modelstate"].(float64); !_ok_ { err = errors.New("modelstate error"); return }; _v.Modelstate = int32(_tempNum_) } { var _ok_ bool; if _v.Point, _ok_ = _buf["point"].(string); !_ok_ { err = errors.New("point error"); return } } diff --git a/sys/configure/structs/Game.Stroy.go b/sys/configure/structs/Game.Stroy.go new file mode 100644 index 000000000..a6fa0afff --- /dev/null +++ b/sys/configure/structs/Game.Stroy.go @@ -0,0 +1,42 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +package cfg + +type GameStroy struct { + _dataMap map[int32]*GameStroyData + _dataList []*GameStroyData +} + +func NewGameStroy(_buf []map[string]interface{}) (*GameStroy, error) { + _dataList := make([]*GameStroyData, 0, len(_buf)) + dataMap := make(map[int32]*GameStroyData) + for _, _ele_ := range _buf { + if _v, err2 := DeserializeGameStroyData(_ele_); err2 != nil { + return nil, err2 + } else { + _dataList = append(_dataList, _v) + dataMap[_v.Id] = _v + } + } + return &GameStroy{_dataList:_dataList, _dataMap:dataMap}, nil +} + +func (table *GameStroy) GetDataMap() map[int32]*GameStroyData { + return table._dataMap +} + +func (table *GameStroy) GetDataList() []*GameStroyData { + return table._dataList +} + +func (table *GameStroy) Get(key int32) *GameStroyData { + return table._dataMap[key] +} + + diff --git a/sys/configure/structs/Game.StroyData.go b/sys/configure/structs/Game.StroyData.go new file mode 100644 index 000000000..0667c7489 --- /dev/null +++ b/sys/configure/structs/Game.StroyData.go @@ -0,0 +1,122 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +package cfg + +import "errors" +import "bright/serialization" + +type GameStroyData struct { + Id int32 + Groupid int32 + Before int32 + Next int32 + Type int32 + Bg string + Place int32 + Speak string + Listen string + Emoji string + Des string + Modelstatetarget string + Modelstate int32 + Modelaction string + State string + Chose []int32 + Turn int32 + Show int32 + Move string + Action string + Sound string + Position serialization.Vector3 + Revolve serialization.Vector3 + Size serialization.Vector3 + Perf string + Cg string + Skip bool +} + +const TypeId_GameStroyData = 1697302313 + +func (*GameStroyData) GetTypeId() int32 { + return 1697302313 +} + +func (_v *GameStroyData)Deserialize(_buf map[string]interface{}) (err error) { + { 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 _tempNum_ float64; if _tempNum_, _ok_ = _buf["groupid"].(float64); !_ok_ { err = errors.New("groupid error"); return }; _v.Groupid = int32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["before"].(float64); !_ok_ { err = errors.New("before error"); return }; _v.Before = int32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["next"].(float64); !_ok_ { err = errors.New("next error"); return }; _v.Next = int32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["type"].(float64); !_ok_ { err = errors.New("type error"); return }; _v.Type = int32(_tempNum_) } + { var _ok_ bool; if _v.Bg, _ok_ = _buf["bg"].(string); !_ok_ { err = errors.New("bg error"); return } } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["place"].(float64); !_ok_ { err = errors.New("place error"); return }; _v.Place = int32(_tempNum_) } + { var _ok_ bool; if _v.Speak, _ok_ = _buf["speak"].(string); !_ok_ { err = errors.New("speak error"); return } } + { var _ok_ bool; if _v.Listen, _ok_ = _buf["listen"].(string); !_ok_ { err = errors.New("listen error"); return } } + { var _ok_ bool; if _v.Emoji, _ok_ = _buf["emoji"].(string); !_ok_ { err = errors.New("emoji error"); return } } + { var _ok_ bool; if _v.Des, _ok_ = _buf["des"].(string); !_ok_ { err = errors.New("des error"); return } } + { var _ok_ bool; if _v.Modelstatetarget, _ok_ = _buf["modelstatetarget"].(string); !_ok_ { err = errors.New("modelstatetarget error"); return } } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["modelstate"].(float64); !_ok_ { err = errors.New("modelstate error"); return }; _v.Modelstate = int32(_tempNum_) } + { var _ok_ bool; if _v.Modelaction, _ok_ = _buf["modelaction"].(string); !_ok_ { err = errors.New("modelaction error"); return } } + { var _ok_ bool; if _v.State, _ok_ = _buf["state"].(string); !_ok_ { err = errors.New("state error"); return } } + { + var _arr_ []interface{} + var _ok_ bool + if _arr_, _ok_ = _buf["chose"].([]interface{}); !_ok_ { err = errors.New("chose error"); return } + + _v.Chose = make([]int32, 0, len(_arr_)) + + for _, _e_ := range _arr_ { + var _list_v_ int32 + { var _ok_ bool; var _x_ float64; if _x_, _ok_ = _e_.(float64); !_ok_ { err = errors.New("_list_v_ error"); return }; _list_v_ = int32(_x_) } + _v.Chose = append(_v.Chose, _list_v_) + } + } + + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["turn"].(float64); !_ok_ { err = errors.New("turn error"); return }; _v.Turn = int32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["show"].(float64); !_ok_ { err = errors.New("show error"); return }; _v.Show = int32(_tempNum_) } + { var _ok_ bool; if _v.Move, _ok_ = _buf["move"].(string); !_ok_ { err = errors.New("move error"); return } } + { var _ok_ bool; if _v.Action, _ok_ = _buf["action"].(string); !_ok_ { err = errors.New("action error"); return } } + { var _ok_ bool; if _v.Sound, _ok_ = _buf["sound"].(string); !_ok_ { err = errors.New("sound error"); return } } + { var _ok_ bool; var _v_ map[string]interface{}; if _v_, _ok_ = _buf["position"].(map[string]interface{}); !_ok_ { err = errors.New("position error"); return } + var _x_, _y_, _z_ float32; + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _v_["x"].(float64); !_ok_ { err = errors.New("x error"); return }; _x_ = float32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _v_["y"].(float64); !_ok_ { err = errors.New("y error"); return }; _y_ = float32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _v_["z"].(float64); !_ok_ { err = errors.New("z error"); return }; _z_ = float32(_tempNum_) } + _v.Position = serialization.NewVector3(_x_, _y_, _z_) + } + + { var _ok_ bool; var _v_ map[string]interface{}; if _v_, _ok_ = _buf["revolve"].(map[string]interface{}); !_ok_ { err = errors.New("revolve error"); return } + var _x_, _y_, _z_ float32; + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _v_["x"].(float64); !_ok_ { err = errors.New("x error"); return }; _x_ = float32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _v_["y"].(float64); !_ok_ { err = errors.New("y error"); return }; _y_ = float32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _v_["z"].(float64); !_ok_ { err = errors.New("z error"); return }; _z_ = float32(_tempNum_) } + _v.Revolve = serialization.NewVector3(_x_, _y_, _z_) + } + + { var _ok_ bool; var _v_ map[string]interface{}; if _v_, _ok_ = _buf["size"].(map[string]interface{}); !_ok_ { err = errors.New("size error"); return } + var _x_, _y_, _z_ float32; + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _v_["x"].(float64); !_ok_ { err = errors.New("x error"); return }; _x_ = float32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _v_["y"].(float64); !_ok_ { err = errors.New("y error"); return }; _y_ = float32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _v_["z"].(float64); !_ok_ { err = errors.New("z error"); return }; _z_ = float32(_tempNum_) } + _v.Size = serialization.NewVector3(_x_, _y_, _z_) + } + + { var _ok_ bool; if _v.Perf, _ok_ = _buf["perf"].(string); !_ok_ { err = errors.New("perf error"); return } } + { var _ok_ bool; if _v.Cg, _ok_ = _buf["cg"].(string); !_ok_ { err = errors.New("cg error"); return } } + { var _ok_ bool; if _v.Skip, _ok_ = _buf["skip"].(bool); !_ok_ { err = errors.New("skip error"); return } } + return +} + +func DeserializeGameStroyData(_buf map[string]interface{}) (*GameStroyData, error) { + v := &GameStroyData{} + if err := v.Deserialize(_buf); err == nil { + return v, nil + } else { + return nil, err + } +} diff --git a/sys/configure/structs/Tables.go b/sys/configure/structs/Tables.go index 6f46c173b..704ec21bc 100644 --- a/sys/configure/structs/Tables.go +++ b/sys/configure/structs/Tables.go @@ -58,6 +58,7 @@ type Tables struct { Facemod *GameFacemod Msgdistrib *GameMsgdistrib Opencond *GameOpencond + Stroy *GameStroy Pagoda *GamePagoda PagodaTaskReward *GamePagodaTaskReward PagodaSeasonReward *GamePagodaSeasonReward @@ -376,6 +377,12 @@ func NewTables(loader JsonLoader) (*Tables, error) { if tables.Opencond, err = NewGameOpencond(buf) ; err != nil { return nil, err } + if buf, err = loader("game_stroy") ; err != nil { + return nil, err + } + if tables.Stroy, err = NewGameStroy(buf) ; err != nil { + return nil, err + } if buf, err = loader("game_pagoda") ; err != nil { return nil, err }