MCPcopy Create free account
hub / github.com/EngoEngine/ecs / TestWorld_AddEntity

Function TestWorld_AddEntity

world_test.go:57–85  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

55func (s *simpleSystem) Update(dt float32) {}
56
57func TestWorld_AddEntity(t *testing.T) {
58
59 type args struct {
60 systems []SystemAddByInterfacer
61 e Identifier
62 }
63 tests := []struct {
64 name string
65 args args
66 }{
67 {"works with multiple interfaces", args{
68 systems: []SystemAddByInterfacer{&simpleSystem{}},
69 e: &simpleEntity{NewBasic()},
70 },
71 },
72 }
73 for _, tt := range tests {
74 t.Run(tt.name, func(t *testing.T) {
75 w := new(World)
76 sys := new(simpleSystem)
77 var face *BasicFace
78 w.AddSystemInterface(sys, []interface{}{face}, nil)
79 w.AddEntity(tt.args.e)
80 if len(sys.entities) == 0 {
81 t.Error(len(sys.entities))
82 }
83 })
84 }
85}
86
87type priorityChangeSystem struct {
88 Rank int

Callers

nothing calls this directly

Calls 3

NewBasicFunction · 0.85
AddSystemInterfaceMethod · 0.80
AddEntityMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…