示例#1
0
// Function to read configurations from file.
void inputConfigurations(void)
{
   float readValue;
   int i;
   Man newMan;

   inFile.open("animateManDataIn.txt");
   
   while (!inFile.eof())
   {
      newMan = Man();
      for (i=0; i < 9; i++)
	  {
         inFile >> readValue;
		
         newMan.setPartAngle(readValue);
         newMan.incrementSelectedPart();
	  }
      inFile >> readValue;
	
      newMan.setUpMove(readValue);
      inFile >> readValue;
      newMan.setForwardMove(readValue);
      manVector.push_back(Man(newMan));
   }
   manVector.pop_back(); // Remove configuration at the back because the routine
                         // read eol after the last configuration and before eof and
                         // creates a fake configuration.
}