Skip to content

fix: remove IFileAccessor and add FileAccessor#13

Merged
kochounoyume merged 2 commits intomainfrom
feature/fix-definition-fileaccessor
Jun 12, 2025
Merged

fix: remove IFileAccessor and add FileAccessor#13
kochounoyume merged 2 commits intomainfrom
feature/fix-definition-fileaccessor

Conversation

@kochounoyume
Copy link
Member

No description provided.

@kochounoyume kochounoyume self-assigned this Jun 12, 2025
Copilot AI review requested due to automatic review settings June 12, 2025 15:59
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR removes the IFileAccessor interface and replaces it with an abstract FileAccessor class that standardizes file system operations for local preferences. Key changes include:

  • Removal of IFileAccessor and its associated default implementation.
  • Introduction of FileAccessor as an abstract base class with a nested DefaultFileAccessor.
  • Updates in LSAccessor, MessagePackLocalPrefs, and JsonLocalPrefs to use FileAccessor instead of IFileAccessor.

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/LocalPrefs/IFileAccessor.cs Removed the obsolete interface in favor of an abstract class.
src/LocalPrefs/FileAccessor.cs Introduced a new abstract class with a nested default implementation.
src/LocalPrefs.Unity/Packages/jp.andantetribe.localprefs/Runtime/LocalPrefs.cs Updated file accessor instantiation to reference the new implementations.
src/LocalPrefs.Unity/Packages/jp.andantetribe.localprefs/Runtime/LSAccessor.cs Changed the base class from IFileAccessor to FileAccessor.
src/LocalPrefs.MessagePack/MessagePackLocalPrefs.cs Updated constructor parameters and property types from IFileAccessor to FileAccessor.
src/LocalPrefs.Json/JsonLocalPrefs.cs Updated constructor parameters and property types from IFileAccessor to FileAccessor.
Comments suppressed due to low confidence (2)

src/LocalPrefs/FileAccessor.cs:7

  • [nitpick] Consider expanding the XML documentation for FileAccessor to clearly explain its role as a replacement for IFileAccessor and to aid users during migration.
public abstract class FileAccessor(string savePath)

src/LocalPrefs.MessagePack/MessagePackLocalPrefs.cs:32

  • Ensure that the change from IFileAccessor to FileAccessor, which may be a breaking change for consumers, is clearly documented in the migration guide and any related dependency injection registrations.
: this(FileAccessor.Create(savePath), resolver == null ? null : MessagePackSerializer.DefaultOptions.WithResolver(resolver))

@kochounoyume kochounoyume merged commit 5c4fa29 into main Jun 12, 2025
4 checks passed
@kochounoyume kochounoyume deleted the feature/fix-definition-fileaccessor branch June 12, 2025 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants