protected void UpdateThrownStars() { //Check if the stars collided with anything for (int i = 0; i < StarsThrown.Count; i++) { StarsThrown[i].Update(); //Make sure the star doesn't go past the designated X value if (StarsThrown[i].Position.X >= StarMaxX) { StarsThrown.RemoveAt(i); i--; continue; } CollisionResponseHolder?collisionResponse = UtilityGlobals.GetCollisionForSet(StarsThrown[i], IconSpawner.RestorationElements); //We have a collision, so handle it if (collisionResponse != null) { //Remove the star and icon IconSpawner.RemoveElement((SweetTreatRestorationElement)collisionResponse.Value.ResponseObj); StarsThrown.RemoveAt(i); i--; //Handle the restore data based on its behavior RestoreBehaviorData restoreData = (RestoreBehaviorData)collisionResponse.Value.CollisionData; HandleRestoreData(restoreData); } } }