wip I guess
This commit is contained in:
@@ -1,28 +1,23 @@
|
||||
package blocks
|
||||
|
||||
import (
|
||||
"image/color"
|
||||
|
||||
"git.vezzani.net/ben/games/common/elements/v1"
|
||||
"git.vezzani.net/ben/games/common/elements/v1/base"
|
||||
)
|
||||
|
||||
type OptFunc func(*Block)
|
||||
|
||||
func Core(f elements.OptFunc) OptFunc {
|
||||
func Core(f base.OptFunc) OptFunc {
|
||||
return func(b *Block) {
|
||||
f(&b.Core)
|
||||
f(&b.Element)
|
||||
}
|
||||
}
|
||||
|
||||
func Size(w, h int) OptFunc {
|
||||
return func(b *Block) {
|
||||
b.width, b.height = w, h
|
||||
}
|
||||
}
|
||||
|
||||
func BackgroundColor(c color.Color) OptFunc {
|
||||
return func(b *Block) {
|
||||
b.backgroundColor = &c
|
||||
func (b Builder) Size(w, h int) Builder {
|
||||
return func() elements.Element {
|
||||
bl := b().(*Block)
|
||||
bl.width, bl.height = w, h
|
||||
return bl
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user