From 1c2ce2d9a9af9871d036b9cf45d221ee8e5a7dcf Mon Sep 17 00:00:00 2001 From: weizhihong Date: Fri, 5 Jan 2024 14:07:43 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=B3=A8=E9=87=8Acomponent=5Fdata/ci.?= =?UTF-8?q?pb.go=E3=80=81component=5Fdata/common.pb.go=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=E6=96=B9=E6=B3=95=E3=80=91=20=E3=80=90=E8=B0=83?= =?UTF-8?q?=E6=95=B4singletion=E6=97=B6=E9=97=B4=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E5=A4=A7=E5=B0=8F=E5=86=99=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- component/component_data/ci.pb.go | 2 +- component/component_data/common.pb.go | 2 +- component/singleton/load.go | 2 +- component/singleton/world_time.go | 2 +- entity/init.go | 2 ++ jl-ecs-go | 2 +- 6 files changed, 7 insertions(+), 5 deletions(-) diff --git a/component/component_data/ci.pb.go b/component/component_data/ci.pb.go index d4141d6..29804be 100644 --- a/component/component_data/ci.pb.go +++ b/component/component_data/ci.pb.go @@ -1156,7 +1156,7 @@ var file_component_ci_proto_depIdxs = []int32{ 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() { if File_component_ci_proto != nil { return diff --git a/component/component_data/common.pb.go b/component/component_data/common.pb.go index d077134..d1dc220 100644 --- a/component/component_data/common.pb.go +++ b/component/component_data/common.pb.go @@ -348,7 +348,7 @@ var file_component_common_proto_depIdxs = []int32{ 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() { if File_component_common_proto != nil { return diff --git a/component/singleton/load.go b/component/singleton/load.go index 8f79bbe..fc3353c 100644 --- a/component/singleton/load.go +++ b/component/singleton/load.go @@ -9,7 +9,7 @@ import ( // 加载并初始化单例组件 func LoadSingletons(w ecs.World, r modelrepo.Repo) { loadWorldRepo(w, r) - loadWorldTime(w) + LoadWorldTime(w) loadUidEntityIndex(w) } diff --git a/component/singleton/world_time.go b/component/singleton/world_time.go index b16f6ee..f2b46cf 100644 --- a/component/singleton/world_time.go +++ b/component/singleton/world_time.go @@ -31,7 +31,7 @@ func (w *WorldTime) GetMilli() int64 { return w.time } -func loadWorldTime(w ecs.World) { +func LoadWorldTime(w ecs.World) { entry := w.Entry(w.Create(WorldTimeType)) WorldTimeType.Set(entry, &WorldTime{time: time.Now().UnixMilli()}) } diff --git a/entity/init.go b/entity/init.go index a6fba5c..e311c75 100644 --- a/entity/init.go +++ b/entity/init.go @@ -2,12 +2,14 @@ package entity import ( "joylink.club/ecs" + "joylink.club/rtsssimulation/component/singleton" "joylink.club/rtsssimulation/repository" ) // 仿真实体加载 func Load(w ecs.World, repo *repository.Repository) error { // 初始化世界数据单例组件 + singleton.LoadWorldTime(w) LoadWorldData(w, repo) // 加载联锁驱采卡相关实体 err := LoadCiQC(w) diff --git a/jl-ecs-go b/jl-ecs-go index bd947ba..f25027e 160000 --- a/jl-ecs-go +++ b/jl-ecs-go @@ -1 +1 @@ -Subproject commit bd947baa4edadb6b7bd059f6e324fb20f8171f8f +Subproject commit f25027e20535e0ae4940a34b80276c56597517fb