Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void Old()
- {
- List<> list = new List<>() ;
- foreach(sceneItem item in scene)
- {
- list.add(item.drawinfo);
- }
- ...
- foreach(item i in list)
- {
- i.Draw(spriteBatch);
- }
- }
- public void New()
- {
- //myPoolArray already existed
- int poolSize;
- foreach(sceneItem item in scene)
- {
- item.SetInfo(myArray[poolSize++]);
- }
- for(int i = 0; i < poolSize; i++)
- {
- myArray[i].Draw(...);
- }
- //note myArray should always be big enough
- }public void Old()
- {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement