AddSystem adds the given System to the World, sorted by priority.
(system System)
| 14 | |
| 15 | // AddSystem adds the given System to the World, sorted by priority. |
| 16 | func (w *World) AddSystem(system System) { |
| 17 | if initializer, ok := system.(Initializer); ok { |
| 18 | initializer.New(w) |
| 19 | } |
| 20 | |
| 21 | w.systems = append(w.systems, system) |
| 22 | sort.Sort(w.systems) |
| 23 | } |
| 24 | |
| 25 | // AddSystemInterface adds a system to the world, but also adds a filter that allows |
| 26 | // automatic adding of entities that match the provided in interface, and excludes any |