rts-sim-module/component/iscs_bas_pipe.go
2024-01-02 17:32:09 +08:00

46 lines
1.2 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package component
import "joylink.club/ecs"
// FluidPipe 流体管线
type FluidPipe struct {
Direction PipeFlowDirection //管线内综合流动方向
FlowSpeed float32 //管线内综合流量m3/h
Sources []*SourceFlow //该管线内所有流体源投射的分量
}
// SourceFlow 流体源进入管线的流体描述
type SourceFlow struct {
Direction PipeFlowDirection
FlowSpeed float32
}
// PipeFlowDirection 管线内流体流动方向定义
type PipeFlowDirection int8
const (
PipeFlowNon PipeFlowDirection = iota //流体未流动
PipeFlowAb //流体从管线的A->B
PipeFlowBa //流体从管线的B->A
)
func (d *PipeFlowDirection) IsFlowAb() bool {
return *d == PipeFlowAb
}
func (d *PipeFlowDirection) IsFlowBa() bool {
return *d == PipeFlowBa
}
func (d *PipeFlowDirection) IsFlowNon() bool {
return *d == PipeFlowNon
}
// FluidDriver 流体驱动器
type FluidDriver struct {
On bool //true-输出流体驱动力false-未输出流体驱动力
}
var (
FluidPipeType = ecs.NewComponentType[FluidPipe]() //流体管线
FluidDriverType = ecs.NewComponentType[FluidDriver]() //流体驱动器
)