-
-
Save AlexeyDsov/78e2f499d96700f163bf87915cfa2b54 to your computer and use it in GitHub Desktop.
Panic illustration at "github.com/yohamta/donburi"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "github.com/yohamta/donburi" | |
type MyData1 struct { | |
} | |
type MyData2 struct { | |
} | |
var ( | |
My1 = donburi.NewComponentType[MyData1]() | |
My2 = donburi.NewComponentType[MyData1]() | |
) | |
func main() { | |
world := donburi.NewWorld() | |
entity := world.Create(My1) | |
entry := world.Entry(entity) | |
_ = donburi.Get[MyData1](entry, My1) | |
donburi.Add[MyData2](entry, My2, &MyData2{}) | |
entity = world.Create(My1) | |
entry = world.Entry(entity) | |
donburi.Add[MyData2](entry, My2, &MyData2{}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment