danielfilipealmeida / adventure_studio

Integrated Development Environment (IDE) designed for creating text-based adventure games.
0 stars 0 forks source link

Refactor Project Model: Introduce File-Based Persistence #10

Closed danielfilipealmeida closed 3 days ago

danielfilipealmeida commented 2 weeks ago

Description:

We need to refactor the Project Swift model to introduce a new class capable of handling file-based loading and saving of projects. The app should be able to manage only one project at a time, with options to load and save that project.


Task Breakdown:

  1. Remove the Current Project Swift Model

    • Eliminate the existing Project model that is currently used.
    • Ensure all associated references in the codebase are updated or removed.
  2. Introduce New Project Class

    • Implement a new Project class that will manage file-based persistence.
    • This class should be able to:
      • Load a project from a file.
      • Save a project to a file.
    • Only one project should be accessible at a time.
  3. Implement Project Loading

    • Create a function to load the project from a file.
    • Handle file not found or invalid file errors.
  4. Implement Project Saving

    • Create a function to save the current project state to a file.
    • Ensure overwriting of existing project files is handled.
  5. Refactor Code for Single Project Access

    • Modify the app's logic to ensure it only handles one project at a time.
    • Ensure UI components (if any) reflect this change.

Acceptance Criteria: