TestChangeableComponents ensures that Components which are being referenced, are changeable
(t *testing.T)
| 197 | |
| 198 | // TestChangeableComponents ensures that Components which are being referenced, are changeable |
| 199 | func TestChangeableComponents(t *testing.T) { |
| 200 | w := &World{} |
| 201 | |
| 202 | sys1 := &MySystemOne{} |
| 203 | w.AddSystem(sys1) |
| 204 | |
| 205 | e1 := MyEntity1{} |
| 206 | e1.BasicEntity = NewBasic() |
| 207 | |
| 208 | sys1.Add(&e1.BasicEntity, &e1.MyComponent1) |
| 209 | |
| 210 | sys1.Update(0.125) |
| 211 | |
| 212 | assert.NotZero(t, e1.MyComponent1.A, "MySystemOne should have been able to change the value of MyComponent1.A") |
| 213 | } |
| 214 | |
| 215 | // TestDelete tests a commonly used method for removing an entity from the list of entities |
| 216 | func TestDelete(t *testing.T) { |