go_dreamfactory/modules/battle/fight/attribute/fixednumeric.go
2022-09-08 17:25:12 +08:00

21 lines
392 B
Go

package attribute
func NewFixedNumeric(pData float32) *FixedNumeric {
fixed := &FixedNumeric{}
fixed.Set(pData)
return fixed
}
type FixedNumeric struct {
baseValue *FixedPoint
}
func (this *FixedNumeric) Set(value float32) float32 {
this.baseValue = NewFixedPoint(value)
return this.baseValue.Scalar()
}
func (this *FixedNumeric) Value() float32 {
return this.baseValue.Scalar()
}