MCPcopy
hub / github.com/EngoEngine/engo / Setup

Method Setup

common/interfaces_test.go:29–119  ·  view source on GitHub ↗
(u engo.Updater)

Source from the content-addressed store, hash-verified

27func (*TestInterfaceScene) Preload() {}
28
29func (s *TestInterfaceScene) Setup(u engo.Updater) {
30 w, _ := u.(*ecs.World)
31
32 asys := AnimationSystem{}
33 var a *Animationable
34 var nota *NotAnimationable
35 w.AddSystemInterface(&asys, a, nota)
36
37 msys := MouseSystem{}
38 var m *Mouseable
39 var notm *NotMouseable
40 w.AddSystemInterface(&msys, m, notm)
41
42 rsys := RenderSystem{}
43 var r *Renderable
44 var notr *NotRenderable
45 w.AddSystemInterface(&rsys, r, notr)
46
47 csys := CollisionSystem{}
48 var c *Collisionable
49 var notc *NotCollisionable
50 w.AddSystemInterface(&csys, c, notc)
51
52 audsys := AudioSystem{}
53 var aud *Audioable
54 var notaud *NotAudioable
55 w.AddSystemInterface(&audsys, aud, notaud)
56
57 e := &EveryComp{BasicEntity: ecs.NewBasic()}
58 w.AddEntity(e)
59
60 if len(asys.entities) != 1 {
61 s.failed = true
62 s.reason = "did not add entity to animation system"
63 return
64 }
65 asys.Remove(e.BasicEntity)
66 if len(asys.entities) != 0 {
67 s.failed = true
68 s.reason = "did not remove entry from animation system"
69 return
70 }
71
72 if len(msys.entities) != 1 {
73 s.failed = true
74 s.reason = "did not add entity to mouse system"
75 return
76 }
77 msys.Remove(e.BasicEntity)
78 if len(msys.entities) != 0 {
79 s.failed = true
80 s.reason = "did not remove entry from mouse system"
81 return
82 }
83
84 if len(rsys.entities) != 1 {
85 s.failed = true
86 s.reason = "did not add entity to render system"

Callers

nothing calls this directly

Calls 5

RemoveMethod · 0.95
RemoveMethod · 0.95
RemoveMethod · 0.95
RemoveMethod · 0.95
RemoveMethod · 0.95

Tested by

no test coverage detected