This commit is contained in:
xzb 2024-01-05 15:21:58 +08:00
commit 9b16941d2f
6 changed files with 7 additions and 5 deletions

View File

@ -1156,7 +1156,7 @@ var file_component_ci_proto_depIdxs = []int32{
0, // [0:16] is the sub-list for field type_name 0, // [0:16] is the sub-list for field type_name
} }
func init() { file_component_ci_proto_init() } //func init() { file_component_ci_proto_init() }
func file_component_ci_proto_init() { func file_component_ci_proto_init() {
if File_component_ci_proto != nil { if File_component_ci_proto != nil {
return return

View File

@ -348,7 +348,7 @@ var file_component_common_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for field type_name 0, // [0:0] is the sub-list for field type_name
} }
func init() { file_component_common_proto_init() } //func init() { file_component_common_proto_init() }
func file_component_common_proto_init() { func file_component_common_proto_init() {
if File_component_common_proto != nil { if File_component_common_proto != nil {
return return

View File

@ -9,7 +9,7 @@ import (
// 加载并初始化单例组件 // 加载并初始化单例组件
func LoadSingletons(w ecs.World, r modelrepo.Repo) { func LoadSingletons(w ecs.World, r modelrepo.Repo) {
loadWorldRepo(w, r) loadWorldRepo(w, r)
loadWorldTime(w) LoadWorldTime(w)
loadUidEntityIndex(w) loadUidEntityIndex(w)
} }

View File

@ -31,7 +31,7 @@ func (w *WorldTime) GetMilli() int64 {
return w.time return w.time
} }
func loadWorldTime(w ecs.World) { func LoadWorldTime(w ecs.World) {
entry := w.Entry(w.Create(WorldTimeType)) entry := w.Entry(w.Create(WorldTimeType))
WorldTimeType.Set(entry, &WorldTime{time: time.Now().UnixMilli()}) WorldTimeType.Set(entry, &WorldTime{time: time.Now().UnixMilli()})
} }

View File

@ -2,12 +2,14 @@ package entity
import ( import (
"joylink.club/ecs" "joylink.club/ecs"
"joylink.club/rtsssimulation/component/singleton"
"joylink.club/rtsssimulation/repository" "joylink.club/rtsssimulation/repository"
) )
// 仿真实体加载 // 仿真实体加载
func Load(w ecs.World, repo *repository.Repository) error { func Load(w ecs.World, repo *repository.Repository) error {
// 初始化世界数据单例组件 // 初始化世界数据单例组件
singleton.LoadWorldTime(w)
LoadWorldData(w, repo) LoadWorldData(w, repo)
// 加载联锁驱采卡相关实体 // 加载联锁驱采卡相关实体
err := LoadCiQC(w) err := LoadCiQC(w)

@ -1 +1 @@
Subproject commit bd947baa4edadb6b7bd059f6e324fb20f8171f8f Subproject commit f25027e20535e0ae4940a34b80276c56597517fb