-
Notifications
You must be signed in to change notification settings - Fork 28
/
apl_values_gcd.go
47 lines (41 loc) · 1.09 KB
/
apl_values_gcd.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package core
import (
"time"
"github.com/wowsims/sod/sim/core/proto"
)
type APLValueGCDIsReady struct {
DefaultAPLValueImpl
unit *Unit
}
func (rot *APLRotation) newValueGCDIsReady(config *proto.APLValueGCDIsReady) APLValue {
return &APLValueGCDIsReady{
unit: rot.unit,
}
}
func (value *APLValueGCDIsReady) Type() proto.APLValueType {
return proto.APLValueType_ValueTypeBool
}
func (value *APLValueGCDIsReady) GetBool(sim *Simulation) bool {
return value.unit.GCD.IsReady(sim)
}
func (value *APLValueGCDIsReady) String() string {
return "GCD Is Ready"
}
type APLValueGCDTimeToReady struct {
DefaultAPLValueImpl
unit *Unit
}
func (rot *APLRotation) newValueGCDTimeToReady(config *proto.APLValueGCDTimeToReady) APLValue {
return &APLValueGCDTimeToReady{
unit: rot.unit,
}
}
func (value *APLValueGCDTimeToReady) Type() proto.APLValueType {
return proto.APLValueType_ValueTypeDuration
}
func (value *APLValueGCDTimeToReady) GetDuration(sim *Simulation) time.Duration {
return value.unit.GCD.TimeToReady(sim)
}
func (value *APLValueGCDTimeToReady) String() string {
return "GCD Time To Ready"
}