private CartridgeSavegame CreateSavegame(CartridgeTag tag, string nameRoot, string suffixFormat, bool isQuickSave, bool isAutoSave, Dictionary<CartridgeTag, CartridgeSavegame> dict)
{
if (!isQuickSave && !isAutoSave)
{
throw new InvalidOperationException("Savegame must be either quick save or auto save");
}
// Makes a savegame.
string intPattern = " {0}";
int saveId = tag.GetLastSavegameNameInteger(nameRoot, intPattern) + 1;
CartridgeSavegame cs = new CartridgeSavegame(tag, nameRoot + String.Format(intPattern, saveId))
{
IsQuicksave = isQuickSave,
IsAutosave = isAutoSave
};
// Sets it as the current save for the tag.
dict[tag] = cs;
// Returns
return cs;
}