os.makedirs(location)
-class SaveGame(object):
+class SaveGameSlot(object):
def __init__(self, slot_num):
self.slot_num = slot_num
selector.add(slot)
def make_slot_widget(self, slot_num):
- game_data = SaveGame(slot_num).get_game_data()
+ game_data = SaveGameSlot(slot_num).get_game_data()
y_offset = 74 * slot_num
slot = SaveSlotWidget((100, y_offset), slot_num, game_data)
slot.add_callback('click', lambda event: self.perform_action(slot_num))
class SaveGameScene(LoadSaveGameBase):
def perform_action(self, slot_num):
try:
- SaveGame(slot_num).save(self.state)
+ SaveGameSlot(slot_num).save(self.state)
except Exception as e:
print "Error saving game in slot %s: %s" % (slot_num, e)
self.fail()
class LoadGameScene(LoadSaveGameBase):
def perform_action(self, slot_num):
- state = SaveGame(slot_num).load()
+ state = SaveGameSlot(slot_num).load()
if state is not None:
LoadGameEvent.post(state)
self.succeed()