| 1 | interface IGameObject { |
| 2 | mut: |
| 3 | name string |
| 4 | } |
| 5 | |
| 6 | struct GameObject implements IGameObject { |
| 7 | mut: |
| 8 | name string |
| 9 | } |
| 10 | |
| 11 | struct Game { |
| 12 | mut: |
| 13 | objects []IGameObject |
| 14 | } |
| 15 | |
| 16 | fn (mut game Game) gc() { |
| 17 | for obj in game.objects { |
| 18 | game.objects.delete(obj) |
| 19 | } |
| 20 | game.objects.clear() |
| 21 | } |
| 22 | |
| 23 | fn main() {} |
| 24 |