Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4243 in orxonox.OLD for orxonox/branches


Ignore:
Timestamp:
May 20, 2005, 4:18:09 AM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: saver loading

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/levelLoader/src/util/loading/load_param.h

    r4242 r4243  
    3636        {
    3737          SubString subLoads(loadString);
    38           (*pt2Object.*function)(subLoads.getString(0), subLoads.getString(1));
     38          if (subLoads.getCount() == 2)
     39            (*pt2Object.*function)(subLoads.getString(0), subLoads.getString(1));
     40          else
     41            PRINTF(2)("Not loaded Parameter %s of %s, because wrong count of arguments.\n -> Should have %d but have %d\n",
     42                      paramName, pt2Object->getClassName(), 2, subLoads.getCount());
    3943        }
    4044      else
     
    4953        {
    5054          SubString subLoads(loadString);
    51           (*pt2Object.*function)(subLoads.getString(0), subLoads.getString(1), subLoads.getString(2));
     55          if (subLoads.getCount() == 3)
     56            (*pt2Object.*function)(subLoads.getString(0), subLoads.getString(1), subLoads.getString(2));
     57          else
     58            PRINTF(2)("Not loaded Parameter %s of %s, because wrong count of arguments.\n -> Should have %d but have %d\n",
     59                      paramName, pt2Object->getClassName(), 3, subLoads.getCount());
    5260        }
    5361      else
     
    6270        {
    6371          SubString subLoads(loadString);
    64           (*pt2Object.*function)(subLoads.getString(0), subLoads.getString(1), subLoads.getString(2), subLoads.getString(3));
     72          if (subLoads.getCount() == 4)
     73            (*pt2Object.*function)(subLoads.getString(0), subLoads.getString(1), subLoads.getString(2), subLoads.getString(3));
     74          else
     75            PRINTF(2)("Not loaded Parameter %s of %s, because wrong count of arguments.\n -> Should have %d but have %d\n",
     76                      paramName, pt2Object->getClassName(), 4, subLoads.getCount());
    6577        }
    6678      else
     
    8597        {
    8698          SubString subLoads(loadString);
    87           (*pt2Object.*function)(atof(subLoads.getString(0)), atof(subLoads.getString(1)));
     99          if (subLoads.getCount() == 2)
     100            (*pt2Object.*function)(atof(subLoads.getString(0)), atof(subLoads.getString(1)));
     101          else
     102            PRINTF(2)("Not loaded Parameter %s of %s, because wrong count of arguments.\n -> Should have %d but have %d\n",
     103                      paramName, pt2Object->getClassName(), 2, subLoads.getCount());
     104           
    88105        }
    89106      else
     
    98115        {
    99116          SubString subLoads(loadString);
    100           (*pt2Object.*function)(atof(subLoads.getString(0)), atof(subLoads.getString(1)), atof(subLoads.getString(2)));
     117          if (subLoads.getCount() == 3)
     118            (*pt2Object.*function)(atof(subLoads.getString(0)), atof(subLoads.getString(1)), atof(subLoads.getString(2)));
     119          else
     120            PRINTF(2)("Not loaded Parameter %s of %s, because wrong count of arguments.\n -> Should have %d but have %d\n",
     121                      paramName, pt2Object->getClassName(), 3, subLoads.getCount());
    101122        }
    102123      else
     
    111132        {
    112133          SubString subLoads(loadString);
    113           (*pt2Object.*function)(atof(subLoads.getString(0)), atof(subLoads.getString(1)), atof(subLoads.getString(2)), atof(subLoads.getString(3)));
     134          if (subLoads.getCount() == 4)
     135            (*pt2Object.*function)(atof(subLoads.getString(0)), atof(subLoads.getString(1)), atof(subLoads.getString(2)), atof(subLoads.getString(3)));
     136          else
     137            PRINTF(2)("Not loaded Parameter %s of %s, because wrong count of arguments.\n -> Should have %d but have %d\n",
     138                      paramName, pt2Object->getClassName(), 4, subLoads.getCount());
     139
    114140        }
    115141      else
     
    134160        {
    135161          SubString subLoads(loadString);
    136           (*pt2Object.*function)(atoi(subLoads.getString(0)), atoi(subLoads.getString(1)));
     162          if (subLoads.getCount() == 2)
     163            (*pt2Object.*function)(atoi(subLoads.getString(0)), atoi(subLoads.getString(1)));
     164          else
     165            PRINTF(2)("Not loaded Parameter %s of %s, because wrong count of arguments.\n -> Should have %d but have %d\n",
     166                      paramName, pt2Object->getClassName(), 2, subLoads.getCount());
     167
    137168        }
    138169      else
     
    147178        {
    148179          SubString subLoads(loadString);
    149           (*pt2Object.*function)(atoi(subLoads.getString(0)), atoi(subLoads.getString(1)), atoi(subLoads.getString(2)));
     180          if (subLoads.getCount() == 3)
     181            (*pt2Object.*function)(atoi(subLoads.getString(0)), atoi(subLoads.getString(1)), atoi(subLoads.getString(2)));
     182          else
     183            PRINTF(2)("Not loaded Parameter %s of %s, because wrong count of arguments.\n -> Should have %d but have %d\n",
     184                      paramName, pt2Object->getClassName(), 3, subLoads.getCount());
     185
    150186        }
    151187      else
     
    160196        {
    161197          SubString subLoads(loadString);
    162           (*pt2Object.*function)(atoi(subLoads.getString(0)), atoi(subLoads.getString(1)), atoi(subLoads.getString(2)), atoi(subLoads.getString(3)));
     198          if (subLoads.getCount() == 4)
     199            (*pt2Object.*function)(atoi(subLoads.getString(0)), atoi(subLoads.getString(1)), atoi(subLoads.getString(2)), atoi(subLoads.getString(3)));
     200          else
     201            PRINTF(2)("Not loaded Parameter %s of %s, because wrong count of arguments.\n -> Should have %d but have %d\n",
     202                      paramName, pt2Object->getClassName(), 4, subLoads.getCount());
    163203        }
    164204      else
Note: See TracChangeset for help on using the changeset viewer.