server/splosion.go

24 lines
474 B
Go
Raw Normal View History

package botserv
import (
v "bitbucket.org/hackerbots/vector"
)
2014-04-14 00:26:41 -07:00
// Splosion embodies an explosion.
type Splosion struct {
2013-11-09 21:46:49 -08:00
Id string `json:"id"`
Position v.Point2d `json:"position"`
Radius int `json:"radius"`
Lifespan int `json:"-"`
}
2014-04-14 00:26:41 -07:00
// Tick decrements the lifespan of said Splosion.
func (s *Splosion) Tick() {
s.Lifespan--
}
2014-04-14 00:26:41 -07:00
// Alive determines if this Splosion is still relevant.
func (s *Splosion) Alive() bool {
return s.Lifespan > 0
}