cleaning up the component system just a bit more...
This commit is contained in:
@@ -1,9 +1,19 @@
|
||||
package blocks
|
||||
|
||||
import "image/color"
|
||||
import (
|
||||
"image/color"
|
||||
|
||||
"git.vezzani.net/ben/games/common/elements/v1"
|
||||
)
|
||||
|
||||
type OptFunc func(*Block)
|
||||
|
||||
func Core(f elements.OptFunc) OptFunc {
|
||||
return func(b *Block) {
|
||||
f(&b.Core)
|
||||
}
|
||||
}
|
||||
|
||||
func Size(w, h int) OptFunc {
|
||||
return func(b *Block) {
|
||||
b.width, b.height = w, h
|
||||
|
||||
Reference in New Issue
Block a user