summaryrefslogtreecommitdiff
path: root/ecs/gameobject.go
blob: 86429d7b55d1181792edaf22a6550eaf07cba90a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package ecs

import (
	"fmt"
	"github.com/Zyko0/go-sdl3/sdl"
)

type GameObject struct {
	Position   sdl.FPoint
	Children   []IsGameObject
	Components []Component
}

func (g *GameObject) GO() *GameObject {
	return g
}

type IsGameObject interface {
	GO() *GameObject
}

func (g *GameObject) Safe(err error) {
	if err != nil {
		fmt.Printf("%v\n", err.Error())
	}
}