Skip to content

Refactor character persistence to use DataManager pattern #28

Description

@FirebrickRed

Priority: MEDIUM
Status: TODO

Description

CharacterPersistenceLoader currently implements its own loading/saving logic separate from the rest of the data loading architecture. It should follow the same pattern as RaceLoader, ClassLoader, etc. and integrate with DataManager.

Problem

Current Architecture:

  • RaceLoader, ClassLoader, SpellLoader, etc. → All called from DataManager
  • CharacterPersistenceLoader → Has its own static methods, called independently

This creates inconsistency:

  • Different initialization patterns
  • Different error handling
  • Harder to understand data flow
  • Character data not managed centrally like other D&D content

Goal

Make character persistence follow the same architectural pattern as other data loaders.

Acceptance Criteria

  • Integrate CharacterPersistenceLoader with DataManager initialization
  • Follow same pattern as other loaders (static registry, getter methods)
  • Consistent error handling and logging
  • Update CharacterSheetManager to use new pattern
  • Ensure backward compatibility with existing saved characters
  • Update CLAUDE.md documentation

Technical Notes

Likely involves:

  • Moving character registry to be managed by DataManager
  • Standardizing the loader interface/pattern
  • May need to create a unified loader base class if pattern keeps repeating

Reference

See RaceLoader.java, ClassLoader.java for the pattern to follow.

Related Issues

This is part of architectural consistency - similar to how we refactored the selection menus (issue #7).

Metadata

Metadata

Assignees

No one assigned

    Labels

    data-loaderYAML loading and data management

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions