1 Star 0 Fork 0

liuxuezhan / mylib

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
CF_LeagueCupTasks.go 1.89 KB
一键复制 编辑 原始数据 按行查看 历史
liuxuezhan 提交于 2020-10-14 10:09 . 'new mylib'
package CSV
import (
"fmt"
"sort"
"gitee.com/liuxuezhan/mylib/Utils/wsort"
)
type CF_LeagueCupTasks_DataEntry struct {
ID int64
Name string
Class int64
TaskType int64
TaskCond string
TaskScore int64
TaskReward string
TaskDuration int64
RefreshWeight int64
TaskPictures string
}
type CF_LeagueCupTasks struct {
BaseManager
m_kDataEntryTable map[int64]*CF_LeagueCupTasks_DataEntry
m_kIdList []int64
}
func (this *CF_LeagueCupTasks) Init() {
this.m_kDataEntryTable = make(map[int64]*CF_LeagueCupTasks_DataEntry)
this.m_kIdList = make([]int64, 0)
kSqlCMD := "SELECT * FROM LeagueCupTasks"
if data, ok := sqliteconn.Query(kSqlCMD); ok {
for i := 0; i < len(data); i++ {
kNewEntry := new(CF_LeagueCupTasks_DataEntry)
kNewEntry.ID = ConvertToInt64(data[i]["ID"])
kNewEntry.Name = data[i]["Name"]
kNewEntry.Class = ConvertToInt64(data[i]["Class"])
kNewEntry.TaskType = ConvertToInt64(data[i]["TaskType"])
kNewEntry.TaskCond = data[i]["TaskCond"]
kNewEntry.TaskScore = ConvertToInt64(data[i]["TaskScore"])
kNewEntry.TaskReward = data[i]["TaskReward"]
kNewEntry.TaskDuration = ConvertToInt64(data[i]["TaskDuration"])
kNewEntry.RefreshWeight = ConvertToInt64(data[i]["RefreshWeight"])
kNewEntry.TaskPictures = data[i]["TaskPictures"]
this.m_kDataEntryTable[kNewEntry.ID] = kNewEntry
this.m_kIdList = append(this.m_kIdList, kNewEntry.ID)
}
} else {
fmt.Println("Query from db3 failed!")
}
sort.Sort(wsort.Int64Slice(this.m_kIdList))
}
func (this *CF_LeagueCupTasks) GetEntryPtr(id int64) *CF_LeagueCupTasks_DataEntry {
if !this.ContainsID(id) {
return nil
}
return this.m_kDataEntryTable[id]
}
func (this *CF_LeagueCupTasks) GetIDList() []int64 {
return this.m_kIdList
}
func (this *CF_LeagueCupTasks) ContainsID(id int64) bool {
if _, ok := this.m_kDataEntryTable[id]; ok {
return true
}
return false
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/liuxuezhan/mylib.git
git@gitee.com:liuxuezhan/mylib.git
liuxuezhan
mylib
mylib
v1.0.9

搜索帮助

344bd9b3 5694891 D2dac590 5694891