reflection goes out of the window

This commit is contained in:
2019-11-10 01:24:45 +03:00
parent bc00262ead
commit f442dc6921
16 changed files with 87 additions and 63 deletions

View File

@ -2,8 +2,8 @@ package types
import (
"github.com/gammazero/deque"
"lab.zaar.be/thefish/alchemyst-go/engine/ecs"
"lab.zaar.be/thefish/alchemyst-go/util"
"reflect"
)
import blt "lab.zaar.be/thefish/bearlibterminal"
@ -106,6 +106,6 @@ func FillColorRing(colorValue uint8, minGlow, maxGlow, step int) *cdeque {
return c
}
func (app Appearance) TypeOf() reflect.Type {
return reflect.TypeOf(app)
func (app Appearance) Type() string {
return ecs.AppearanceComponent
}

View File

@ -1,16 +1,16 @@
package types
import (
"lab.zaar.be/thefish/alchemyst-go/engine/ecs"
"math"
"reflect"
)
type Coords struct {
X, Y int
}
func (сс Coords) TypeOf() reflect.Type {
return reflect.TypeOf(сс)
func (сс Coords) Type() string {
return ecs.CoordsComponent
}
func (c *Coords) Get() (int, int) {