Esempio n. 1
0
GameObjects
LevelObjects::getObjectsInPortal()
{
   GameObjects objects;

   CHUint sz = (CHUint)m_data->objects.size();
   for( CHUint i=0; i<sz; ++i )
   {
      if( isObjectWithinPortal( *(m_data->objects[i])) )
         objects.push_back(m_data->objects[i]);
   }

	return objects;
}
    GameObjects gameObjectsAllFromFile(const filesys::path& file) {
        GameObjects obj;
		//Read in source
		IFileStream stream(file.c_str(), std::ios::in);
		if (!stream.is_open()) {
			LOG_ERROR(General, "Cant open file for reading (%s).", file.c_str());
            return obj;
        }

        String line;
        while(std::getline(stream, line)){
            std::transform(line.begin(), line.end(), line.begin(), ::tolower);
            if(line.compare("start obj") == 0){
                obj.push_back(gameObjectFromStream(stream));
            }
        }
        stream.close();
        return obj;
    }