2021-08-03 14:56:53 +10:00
|
|
|
package engine
|
|
|
|
|
|
|
|
import (
|
|
|
|
"encoding/gob"
|
|
|
|
"image"
|
|
|
|
)
|
|
|
|
|
2021-08-18 16:34:51 +10:00
|
|
|
var _ Collider = SolidRect{}
|
|
|
|
|
2021-08-03 14:56:53 +10:00
|
|
|
func init() {
|
|
|
|
gob.Register(SolidRect{})
|
|
|
|
}
|
|
|
|
|
|
|
|
type SolidRect struct {
|
2021-08-03 16:48:21 +10:00
|
|
|
ID
|
2021-08-23 10:34:56 +10:00
|
|
|
Bounds
|
2021-08-03 14:56:53 +10:00
|
|
|
}
|
|
|
|
|
2021-08-23 10:34:56 +10:00
|
|
|
func (s SolidRect) CollidesWith(r image.Rectangle) bool { return s.BoundingRect().Overlaps(r) }
|