スタイル: コーディング規約に準拠したコードフォーマットの適用(this.の明示、空白スタイルの統一)

- 自インスタンスメンバーアクセスへの this. 付与(28ファイル)
- .editorconfig に準拠したインデント・波括弧・空白スタイルの適用
- UTF-8 (BOMあり)、CRLF改行コード、行末空白除去の整合性検証
This commit is contained in:
armonica committed 2026-10-20 10:14:26 +09:00
1 parent 2fa40c950f
commit ae86b53147
28 files changed
+1362 -1380

No files matched your search

+32 -32
View File
@@ -21,22 +21,22 @@ namespace GameLauncher.Engines.Unity
/// <summary>[Game]_Data ディレクトリ絶対パス</summary>
public string DataDirectoryPath
{
get => _dataDirectoryPath;
set { if (_dataDirectoryPath != value) { _dataDirectoryPath = value; OnPropertyChanged(); } }
get => this._dataDirectoryPath;
set { if (this._dataDirectoryPath != value) { this._dataDirectoryPath = value; this.OnPropertyChanged(); } }
}
/// <summary>app.info 由来の会社名/開発者名</summary>
public string CompanyName
{
get => _companyName;
get => this._companyName;
set
{
if (_companyName != value)
if (this._companyName != value)
{
_companyName = value;
OnPropertyChanged();
OnPropertyChanged(nameof(RegistryPath));
OnPropertyChanged(nameof(LocalLowPath));
this._companyName = value;
this.OnPropertyChanged();
this.OnPropertyChanged(nameof(this.RegistryPath));
this.OnPropertyChanged(nameof(this.LocalLowPath));
}
}
}
@@ -44,35 +44,35 @@ namespace GameLauncher.Engines.Unity
/// <summary>app.info 由来の製品名</summary>
public string ProductName
{
get => _productName;
get => this._productName;
set
{
if (_productName != value)
if (this._productName != value)
{
_productName = value;
OnPropertyChanged();
OnPropertyChanged(nameof(RegistryPath));
OnPropertyChanged(nameof(LocalLowPath));
this._productName = value;
this.OnPropertyChanged();
this.OnPropertyChanged(nameof(this.RegistryPath));
this.OnPropertyChanged(nameof(this.LocalLowPath));
}
}
}
public override bool IsIL2CPP => BackendType == UnityBackendType.IL2CPP;
public override bool IsMono => BackendType == UnityBackendType.Mono;
public override bool IsIL2CPP => this.BackendType == UnityBackendType.IL2CPP;
public override bool IsMono => this.BackendType == UnityBackendType.Mono;
/// <summary>バックエンド形式 (IL2CPP / Mono)</summary>
public UnityBackendType BackendType
{
get => _backendType;
get => this._backendType;
set
{
if (_backendType != value)
if (this._backendType != value)
{
_backendType = value;
OnPropertyChanged();
OnPropertyChanged(nameof(BackendBadgeText));
OnPropertyChanged(nameof(IsIL2CPP));
OnPropertyChanged(nameof(IsMono));
this._backendType = value;
this.OnPropertyChanged();
this.OnPropertyChanged(nameof(this.BackendBadgeText));
this.OnPropertyChanged(nameof(this.IsIL2CPP));
this.OnPropertyChanged(nameof(this.IsMono));
}
}
}
@@ -80,15 +80,15 @@ namespace GameLauncher.Engines.Unity
/// <summary>Unityバージョン文字列</summary>
public override string UnityVersion
{
get => _unityVersion;
set { if (_unityVersion != value) { _unityVersion = value; OnPropertyChanged(); } }
get => this._unityVersion;
set { if (this._unityVersion != value) { this._unityVersion = value; this.OnPropertyChanged(); } }
}
/// <summary>セーブデータ(レジストリまたはファイル)が検出されたかどうか</summary>
public override bool HasSaveData
{
get => _hasSaveData;
set { if (_hasSaveData != value) { _hasSaveData = value; OnPropertyChanged(); } }
get => this._hasSaveData;
set { if (this._hasSaveData != value) { this._hasSaveData = value; this.OnPropertyChanged(); } }
}
/// <summary>
@@ -99,9 +99,9 @@ namespace GameLauncher.Engines.Unity
{
get
{
if (string.IsNullOrEmpty(CompanyName) || string.IsNullOrEmpty(ProductName))
if (string.IsNullOrEmpty(this.CompanyName) || string.IsNullOrEmpty(this.ProductName))
return string.Empty;
return $@"Software\{CompanyName}\{ProductName}";
return $@"Software\{this.CompanyName}\{this.ProductName}";
}
}
@@ -113,18 +113,18 @@ namespace GameLauncher.Engines.Unity
{
get
{
if (string.IsNullOrEmpty(CompanyName) || string.IsNullOrEmpty(ProductName))
if (string.IsNullOrEmpty(this.CompanyName) || string.IsNullOrEmpty(this.ProductName))
return string.Empty;
var localAppData = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
var appData = Path.GetDirectoryName(localAppData);
if (string.IsNullOrEmpty(appData)) return string.Empty;
return Path.Combine(appData, "LocalLow", CompanyName, ProductName);
return Path.Combine(appData, "LocalLow", this.CompanyName, this.ProductName);
}
}
public override string BackendBadgeText => BackendType switch
public override string BackendBadgeText => this.BackendType switch
{
UnityBackendType.IL2CPP => "IL2CPP",
UnityBackendType.Mono => "Mono",
+37 -37
View File
@@ -28,35 +28,35 @@ namespace GameLauncher.Engines.Unity
/// <summary>レジストリの生キー名(例: ClearedLevel_h1378399435)</summary>
public string RawKey
{
get => _rawKey;
set { if (_rawKey != value) { _rawKey = value; OnPropertyChanged(); } }
get => this._rawKey;
set { if (this._rawKey != value) { this._rawKey = value; this.OnPropertyChanged(); } }
}
/// <summary>Unityのハッシュを除去した整形式キー名(例: ClearedLevel)</summary>
public string CleanKey
{
get => _cleanKey;
set { if (_cleanKey != value) { _cleanKey = value; OnPropertyChanged(); } }
get => this._cleanKey;
set { if (this._cleanKey != value) { this._cleanKey = value; this.OnPropertyChanged(); } }
}
/// <summary>値のデータ型</summary>
public PlayerPrefsType Type
{
get => _type;
set { if (_type != value) { _type = value; OnPropertyChanged(); OnPropertyChanged(nameof(TypeDisplay)); } }
get => this._type;
set { if (this._type != value) { this._type = value; this.OnPropertyChanged(); this.OnPropertyChanged(nameof(this.TypeDisplay)); } }
}
/// <summary>実際の値(int, float, string, byte[])</summary>
public object? Value
{
get => _value;
get => this._value;
set
{
if (!Equals(_value, value))
if (!Equals(this._value, value))
{
_value = value;
OnPropertyChanged();
UpdateEditValue();
this._value = value;
this.OnPropertyChanged();
this.UpdateEditValue();
}
}
}
@@ -64,15 +64,15 @@ namespace GameLauncher.Engines.Unity
/// <summary>UI表示・編集用の文字列値</summary>
public string EditValue
{
get => _editValue;
get => this._editValue;
set
{
if (_editValue != value)
if (this._editValue != value)
{
_editValue = value;
_isModified = true;
OnPropertyChanged();
OnPropertyChanged(nameof(IsModified));
this._editValue = value;
this._isModified = true;
this.OnPropertyChanged();
this.OnPropertyChanged(nameof(this.IsModified));
}
}
}
@@ -80,11 +80,11 @@ namespace GameLauncher.Engines.Unity
/// <summary>値が変更されたかどうか</summary>
public bool IsModified
{
get => _isModified;
set { if (_isModified != value) { _isModified = value; OnPropertyChanged(); } }
get => this._isModified;
set { if (this._isModified != value) { this._isModified = value; this.OnPropertyChanged(); } }
}
public string TypeDisplay => Type switch
public string TypeDisplay => this.Type switch
{
PlayerPrefsType.Int => "Int (数値)",
PlayerPrefsType.Float => "Float (小数)",
@@ -95,19 +95,19 @@ namespace GameLauncher.Engines.Unity
private void UpdateEditValue()
{
if (_value == null)
if (this._value == null)
{
_editValue = string.Empty;
this._editValue = string.Empty;
}
else if (_value is byte[] bytes)
else if (this._value is byte[] bytes)
{
try
{
var text = System.Text.Encoding.UTF8.GetString(bytes).TrimEnd('\0');
if (text.All(c => !char.IsControl(c) || c == '\r' || c == '\n' || c == '\t'))
{
_editValue = text;
_type = PlayerPrefsType.String;
this._editValue = text;
this._type = PlayerPrefsType.String;
return;
}
}
@@ -118,21 +118,21 @@ namespace GameLauncher.Engines.Unity
float f = BitConverter.ToSingle(bytes, 0);
if (!float.IsNaN(f) && !float.IsInfinity(f))
{
_editValue = f.ToString("G");
_type = PlayerPrefsType.Float;
this._editValue = f.ToString("G");
this._type = PlayerPrefsType.Float;
return;
}
}
_editValue = BitConverter.ToString(bytes).Replace("-", " ");
this._editValue = BitConverter.ToString(bytes).Replace("-", " ");
}
else
{
_editValue = _value.ToString() ?? string.Empty;
this._editValue = this._value.ToString() ?? string.Empty;
}
_isModified = false;
OnPropertyChanged(nameof(EditValue));
OnPropertyChanged(nameof(IsModified));
this._isModified = false;
this.OnPropertyChanged(nameof(this.EditValue));
this.OnPropertyChanged(nameof(this.IsModified));
}
}
@@ -152,13 +152,13 @@ namespace GameLauncher.Engines.Unity
{
get
{
if (FileSize < 1024) return $"{FileSize} B";
if (FileSize < 1024 * 1024) return $"{FileSize / 1024.0:F1} KB";
return $"{FileSize / (1024.0 * 1024.0):F2} MB";
if (this.FileSize < 1024) return $"{this.FileSize} B";
if (this.FileSize < 1024 * 1024) return $"{this.FileSize / 1024.0:F1} KB";
return $"{this.FileSize / (1024.0 * 1024.0):F2} MB";
}
}
public string LastModifiedDisplay => LastModified.ToString("yyyy/MM/dd HH:mm:ss");
public string LastModifiedDisplay => this.LastModified.ToString("yyyy/MM/dd HH:mm:ss");
}
/// <summary>
@@ -172,6 +172,6 @@ namespace GameLauncher.Engines.Unity
public string BackupType { get; set; } = string.Empty; // "Registry (.reg)" または "ファイル"
public string Note { get; set; } = string.Empty;
public string TimestampDisplay => Timestamp.ToString("yyyy/MM/dd HH:mm:ss");
public string TimestampDisplay => this.Timestamp.ToString("yyyy/MM/dd HH:mm:ss");
}
}
+9 -9
View File
@@ -81,7 +81,7 @@ namespace GameLauncher.Engines.Unity
catch { }
// キー名昇順でソート
return list.OrderBy(e => e.CleanKey, StringComparer.OrdinalIgnoreCase).ToList();
return [.. list.OrderBy(e => e.CleanKey, StringComparer.OrdinalIgnoreCase)];
}
/// <summary>
@@ -319,7 +319,7 @@ namespace GameLauncher.Engines.Unity
proc?.WaitForExit(3000);
// JSONバックアップも併せて出力
var entries = GetPlayerPrefs(registryPath);
var entries = this.GetPlayerPrefs(registryPath);
var jsonBackupFile = Path.Combine(backupDir, $"PlayerPrefs_{timestamp}.json");
var serializableList = entries.Select(e => new
{
@@ -416,7 +416,7 @@ namespace GameLauncher.Engines.Unity
FileSize = fi.Length,
LastModified = fi.LastWriteTime,
LocationType = "LocalLow",
IsTextOrJson = CheckIsTextOrJson(f)
IsTextOrJson = this.CheckIsTextOrJson(f)
});
}
}
@@ -429,7 +429,7 @@ namespace GameLauncher.Engines.Unity
try
{
// ルート直下
CollectCandidateFiles(game.RootDirectory, "ゲームフォルダ", list);
this.CollectCandidateFiles(game.RootDirectory, "ゲームフォルダ", list);
// Save / SaveData / saves / savedata サブフォルダ
var subNames = new[] { "Save", "SaveData", "saves", "savedata", "Save_Data" };
@@ -438,21 +438,21 @@ namespace GameLauncher.Engines.Unity
var subPath = Path.Combine(game.RootDirectory, sub);
if (Directory.Exists(subPath))
{
CollectCandidateFiles(subPath, "ゲームフォルダ/" + sub, list, isStrict: false);
this.CollectCandidateFiles(subPath, "ゲームフォルダ/" + sub, list, isStrict: false);
}
}
// Dataフォルダ直下のセーブファイル候補
if (!string.IsNullOrEmpty(game.DataDirectoryPath) && Directory.Exists(game.DataDirectoryPath))
{
CollectCandidateFiles(game.DataDirectoryPath, "Dataフォルダ", list);
this.CollectCandidateFiles(game.DataDirectoryPath, "Dataフォルダ", list);
}
}
catch { }
}
// 更新日時降順でソート
return list.OrderByDescending(f => f.LastModified).ToList();
return [.. list.OrderByDescending(f => f.LastModified)];
}
private void CollectCandidateFiles(string dir, string locationLabel, List<SaveFileEntry> list, bool isStrict = true)
@@ -494,7 +494,7 @@ namespace GameLauncher.Engines.Unity
FileSize = fi.Length,
LastModified = fi.LastWriteTime,
LocationType = locationLabel,
IsTextOrJson = CheckIsTextOrJson(f)
IsTextOrJson = this.CheckIsTextOrJson(f)
});
}
}
@@ -649,7 +649,7 @@ namespace GameLauncher.Engines.Unity
}
catch { }
return list.OrderByDescending(b => b.Timestamp).ToList();
return [.. list.OrderByDescending(b => b.Timestamp)];
}
/// <summary>