2019-04-10 02:17:56 +00:00
|
|
|
// Package dummy implements a dummy doodads.Drawing.
|
|
|
|
package dummy
|
|
|
|
|
2020-04-05 04:00:32 +00:00
|
|
|
import (
|
2022-09-24 22:17:25 +00:00
|
|
|
"git.kirsle.net/SketchyMaze/doodle/pkg/doodads"
|
2020-04-05 04:00:32 +00:00
|
|
|
"git.kirsle.net/go/render"
|
|
|
|
)
|
2019-04-10 02:17:56 +00:00
|
|
|
|
|
|
|
// Drawing is a dummy doodads.Drawing that has no data.
|
|
|
|
type Drawing struct {
|
2020-04-05 04:00:32 +00:00
|
|
|
Drawing *doodads.Drawing
|
2019-04-10 02:17:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewDrawing creates a new dummy drawing.
|
|
|
|
func NewDrawing(id string, doodad *doodads.Doodad) *Drawing {
|
|
|
|
return &Drawing{
|
|
|
|
Drawing: doodads.NewDrawing(id, doodad),
|
|
|
|
}
|
|
|
|
}
|
2020-04-05 04:00:32 +00:00
|
|
|
|
|
|
|
// Size returns the size of the underlying doodads.Drawing.
|
|
|
|
func (d *Drawing) Size() render.Rect {
|
|
|
|
return d.Drawing.Size()
|
|
|
|
}
|
2021-06-03 04:49:29 +00:00
|
|
|
|
|
|
|
// MoveTo changes the drawing's position.
|
|
|
|
func (d *Drawing) MoveTo(to render.Point) {
|
|
|
|
d.Drawing.MoveTo(to)
|
|
|
|
}
|
2021-10-10 03:45:38 +00:00
|
|
|
|
|
|
|
// Grounded satisfies the collision.Actor interface.
|
|
|
|
func (d *Drawing) Grounded() bool {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetGrounded satisfies the collision.Actor interface.
|
|
|
|
func (d *Drawing) SetGrounded(v bool) {}
|
|
|
|
|
|
|
|
// Position satisfies the collision.Actor interface.
|
|
|
|
func (d *Drawing) Position() render.Point {
|
|
|
|
return render.Point{}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Hitbox satisfies the collision.Actor interface.
|
|
|
|
func (d *Drawing) Hitbox() render.Rect {
|
|
|
|
return render.Rect{}
|
|
|
|
}
|