cof: added SpeedToFPS method
This commit is contained in:
parent
b4cd34e351
commit
e7c5efe8e4
|
@ -0,0 +1,16 @@
|
|||
package d2cof
|
||||
|
||||
// SpeedToFPS returns FPS value basing on cof's speed
|
||||
func (c *COF) SpeedToFPS() float64 {
|
||||
const (
|
||||
baseFPS = 25
|
||||
speedDivisor = 256
|
||||
)
|
||||
|
||||
fps := baseFPS * (float64(c.Speed) / speedDivisor)
|
||||
if fps == 0 {
|
||||
fps = baseFPS
|
||||
}
|
||||
|
||||
return fps
|
||||
}
|
Loading…
Reference in New Issue