tins2020/tools.go

27 lines
513 B
Go
Raw Normal View History

package tins2020
2020-05-17 08:56:56 +00:00
import "opslag.de/schobers/geom"
type Tool interface {
Type() string
2020-05-17 08:56:56 +00:00
ClickedTile(*Game, geom.Point)
}
type PlantFlowerTool struct {
FlowerID string
}
func (t *PlantFlowerTool) Type() string { return "plant-flower" }
2020-05-17 08:56:56 +00:00
func (t *PlantFlowerTool) ClickedTile(game *Game, tile geom.Point) {
game.PlantFlower(t.FlowerID, tile)
}
type ShovelTool struct{}
func (t *ShovelTool) Type() string { return "shovel" }
2020-05-17 08:56:56 +00:00
func (t *ShovelTool) ClickedTile(game *Game, tile geom.Point) {
game.Dig(tile)
}