rts-sim-module/deprecated/entities/common_entity.go
walker 0bba8f0934 删除donburi包引用
修改filter导入为从ecs项目导入
整理包结构,将弃用的包放入deprecated文件中
2023-10-09 11:17:25 +08:00

23 lines
657 B
Go

package entities
import (
"time"
"joylink.club/ecs"
"joylink.club/rtsssimulation/deprecated/system"
)
// CreateModelStorageEntity 创建模型仓库实体
func CreateModelStorageEntity(w ecs.World, modelManager system.IModelManager) *ecs.Entry {
e := w.Create(system.ModelStorageComponent)
system.ModelStorageComponent.Set(e, &system.ModelStorageRef{ModelManager: modelManager})
return e
}
// CreateSystemTimerEntity 创建系统时钟实体
func CreateSystemTimerEntity(w ecs.World, systemTime time.Time) *ecs.Entry {
e := w.Create(system.SystemTimerComponent)
system.SystemTimerComponent.Set(e, system.NewSystemTimer(&systemTime))
return e
}