26 lines
580 B
Go
26 lines
580 B
Go
package component
|
|
|
|
import "joylink.club/ecs"
|
|
|
|
// Sensor 传感器
|
|
type Sensor struct {
|
|
Value float32
|
|
}
|
|
|
|
// ThSensor 温湿度传感器
|
|
type ThSensor struct {
|
|
T float32 //温度
|
|
H float32 //湿度
|
|
}
|
|
|
|
var (
|
|
SensorType = ecs.NewComponentType[Sensor]()
|
|
ThSensorType = ecs.NewComponentType[ThSensor]()
|
|
|
|
CO2SensorTag = ecs.NewTag() //CO2 传感器
|
|
WaterTSensorTag = ecs.NewTag() //水温传感器
|
|
PressureSensorTag = ecs.NewTag() //压力传感器
|
|
FlowSensorTag = ecs.NewTag() //流量传感器
|
|
TemperatureSensorTag = ecs.NewTag() //温度传感器
|
|
)
|