Пример #1
0
void SavegameList::LoadPlaybacks(const std::vector<std::string>& filenames)
{
	m_replays.clear();
	const size_t size = filenames.size();
	for (size_t i = 0; i < size; ++i) {
		const std::string fn = filenames[i];
		StoredGame& rep_ref = AddPlayback(i);

		if (!GetSavegameInfos(fn, rep_ref)) {
			RemovePlayback(rep_ref.id);
		}
	}
}
Пример #2
0
void SavegameList::LoadPlaybacks( const wxArrayString& filenames )
{
    m_fails = 0;

    m_replays.clear();
    size_t size = filenames.GetCount();
    for ( size_t i = 0; i < size; ++i)
    {
        wxString fn = filenames[i];
		Savegame& rep_ref = AddPlayback( i ); // don't touch this reference, since elements inside this data structure are filled using pointers, adding & not fecthing the new addresses would screw up references when rep gets destroyed

        if ( !GetSavegameInfos( filenames[i] , rep_ref ) )
        {
			RemovePlayback( rep_ref.id );
            m_fails++;
        }
    }
}