I have a type called foodPellet, and a Tlist of 400 of them. They need to be able to delete themselves from the list, but I don't know how to do that. I created the list like this:
Global foodlist:TList = CreateList()
For i = 0 To 400
ListAddLast(foodlist, foodpellet.create(Rand(1,4), width/2 + Rand(-1500,1500), height/2 + Rand(-1500,1500), gameGraphics))
Next
Individual foodpellets know when its time for them to be deleted, and I run through the list updating them all, so they can call a deleteme() method inside them, but I dont know how to delete them from the list, or even how to make them know what member of the list they are. I think it may be related to something else I dont know how to do: From an instance of a type, getting the instance, like, getting a var to be itself. Thanks in advance, Will.
Global foodlist:TList = CreateList()
For i = 0 To 400
ListAddLast(foodlist, foodpellet.create(Rand(1,4), width/2 + Rand(-1500,1500), height/2 + Rand(-1500,1500), gameGraphics))
Next
Individual foodpellets know when its time for them to be deleted, and I run through the list updating them all, so they can call a deleteme() method inside them, but I dont know how to delete them from the list, or even how to make them know what member of the list they are. I think it may be related to something else I dont know how to do: From an instance of a type, getting the instance, like, getting a var to be itself. Thanks in advance, Will.