title: Unable to assign saved values to list from file
body: <p>We're developing a game engine which will involve loading sprites, audio clips and such, all extending from the 'Actor' abstract class. We're able to iterate through a list of actor elements through a for loop and save the following values:</p>
  
  <p>Type &lt;&lt; ID &lt;&lt; x &lt;&lt; y &lt;&lt; width &lt;&lt; height &lt;&lt; textureDirectory &lt;&lt; endl;</p>
  
  <p>Each line in the file represents one actor and its properties. When loading, the values for each line prints out perfectly, however the actors merge when rendering in the level editor, so in fact the properties are adding onto each one another.</p>
  
  <p>Here is the code for loading in the actors:</p>
  
  <pre><code>GLvoid Load::loadActor(list&lt;Components::Actor*&gt;::iterator it)
  {
      // Clear scene data
      Components::Actor::actors.clear();
  
      // Open file
      std::cout &lt;&lt; "\nOpen: ";
      cin &gt;&gt;  cinData;
      inFile.open("Content/Maps/" + cinData + ".sol", std::ifstream::in);
  
      // Iterate and add actor types to Actor::actors list
      string line;
      vector &lt;int&gt; getType;
      vector &lt;int&gt; getID;
      vector &lt;float&gt; getX;
      vector &lt;float&gt; getY;
      vector &lt;float&gt; getWidth;
      vector &lt;float&gt; getHeight;
      vector &lt;string&gt; getTexDir;
      int lines = 0;
  
      while (getline(inFile, line))
      {
          stringstream iss(line);
          int type;
          int id;
          float x;
          float y;
          float w;
          float h;
          string td;
  
          // Read and pack temp values in vector lists
          if (iss &gt;&gt; type &gt;&gt; id &gt;&gt; x &gt;&gt; y &gt;&gt; w &gt;&gt; h &gt;&gt; td)
          {
              getType.push_back(type);
              getID.push_back(id);
              getX.push_back(x);
              getY.push_back(y);
              getWidth.push_back(w);
              getHeight.push_back(h);
              getTexDir.push_back(td);
  
              cout &lt;&lt; "All values have been read..." &lt;&lt; endl;
          }
  
          // Reset temp values
          type = 0;
          id = 0;
          x = 0.0f;
          y = 0.0f;
          w = 0.0f;
          h = 0.0f;
          td = "";
  
          // Create actor types
          switch(type)
          {
          case Components::Actor::T_SPRITE:
  
              Components::ActorHandler::create(new Components::Sprite(true));
              for ( it = Components::Actor::actors.begin(); it != Components::Actor::actors.end(); it++)
              {
                  Components::Actor *actorList = (*it);
  
                  actorList-&gt;setID(getID[lines]);
                  actorList-&gt;setX(getX[lines]);
                  actorList-&gt;setY(getY[lines]);
                  actorList-&gt;setWidth(getWidth[lines]);
                  actorList-&gt;setHeight(getHeight[lines]);
                  actorList-&gt;setTextureDir(getTexDir[lines]);
                  actorList-&gt;texture2D.loadTexture(getTexDir[lines]);
  
                  std::cout &lt;&lt; "Type: " &lt;&lt; actorList-&gt;getType() &lt;&lt; " ID: " &lt;&lt; actorList-&gt;getID() &lt;&lt; " X pos: " &lt;&lt; actorList-&gt;getX() &lt;&lt; " Y pos: " &lt;&lt; actorList-&gt;getY() &lt;&lt; " Width: " &lt;&lt; actorList-&gt;getWidth() &lt;&lt; " Height: "  &lt;&lt; actorList-&gt;getHeight() &lt;&lt; " TexDir: "  &lt;&lt; actorList-&gt;getTextureDir() &lt;&lt; endl;
              }
              break;
  
          default:
              break;
          }
  
          lines++;
      }
  
      std::cout &lt;&lt; "Lines detected: " &lt;&lt; lines &lt;&lt; endl;
  
      // Close file
      inFile.close();
  
      // Destroy temp data
      getType.clear();
      getID.clear();
      getX.clear();
      getY.clear();
      getWidth.clear();
      getHeight.clear();
      getTexDir.clear();
  
      std::cout &lt;&lt; "Load success!" &lt;&lt; endl;
      enter code here
  
  }
  </code></pre>