Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.58 KB | None | 0 0
  1. public void Old()
  2. {
  3.     List<> list = new List<>()   ;
  4.     foreach(sceneItem item in scene)
  5.     {
  6.         list.add(item.drawinfo);
  7.     }
  8.    
  9.     ...
  10.    
  11.     foreach(item i in list)
  12.     {
  13.         i.Draw(spriteBatch);
  14.     }
  15. }
  16.  
  17. public void New()
  18. {
  19.    //myPoolArray already existed
  20.    int poolSize;
  21.    foreach(sceneItem item in scene)
  22.    {    
  23.         item.SetInfo(myArray[poolSize++]);        
  24.    }
  25.    
  26.    for(int i = 0; i < poolSize; i++)
  27.    {
  28.        myArray[i].Draw(...);
  29.    }
  30.    
  31.    //note myArray should always be big enough
  32.    
  33. }public void Old()
  34. {
  35.    
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement