feat: 初回コミット (GameLauncher)
This commit is contained in:
commit
7ac4dbc825
45 files changed
+9779
No files matched your search
@@ -0,0 +1,216 @@
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace GameLauncher.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// すべてのゲームアイテムの共通基底クラス
|
||||
/// </summary>
|
||||
public abstract class GameItemBase : INotifyPropertyChanged
|
||||
{
|
||||
private static readonly ObservableCollection<ModPluginOptionItem> _emptyPluginOptions = [];
|
||||
private string _title = string.Empty;
|
||||
private string _folderName = string.Empty;
|
||||
private string _rootDirectory = string.Empty;
|
||||
private string _executablePath = string.Empty;
|
||||
private ImageSource? _iconImage;
|
||||
private DateTime? _lastLaunched;
|
||||
private DateTime? _folderLastModified;
|
||||
|
||||
public event PropertyChangedEventHandler? PropertyChanged;
|
||||
|
||||
protected void OnPropertyChanged([CallerMemberName] string? propertyName = null)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
|
||||
/// <summary>ゲームの表示タイトル</summary>
|
||||
public string Title
|
||||
{
|
||||
get => _title;
|
||||
set { if (_title != value) { _title = value; OnPropertyChanged(); } }
|
||||
}
|
||||
|
||||
/// <summary>フォルダ名</summary>
|
||||
public string FolderName
|
||||
{
|
||||
get => _folderName;
|
||||
set { if (_folderName != value) { _folderName = value; OnPropertyChanged(); } }
|
||||
}
|
||||
|
||||
/// <summary>ゲームのルートディレクトリ絶対パス</summary>
|
||||
public string RootDirectory
|
||||
{
|
||||
get => _rootDirectory;
|
||||
set { if (_rootDirectory != value) { _rootDirectory = value; OnPropertyChanged(); } }
|
||||
}
|
||||
|
||||
/// <summary>ゲームの実行ファイル(.exe等)絶対パス</summary>
|
||||
public string ExecutablePath
|
||||
{
|
||||
get => _executablePath;
|
||||
set { if (_executablePath != value) { _executablePath = value; OnPropertyChanged(); } }
|
||||
}
|
||||
|
||||
/// <summary>アプリアイコン画像</summary>
|
||||
public ImageSource? IconImage
|
||||
{
|
||||
get => _iconImage;
|
||||
set { if (_iconImage != value) { _iconImage = value; OnPropertyChanged(); } }
|
||||
}
|
||||
|
||||
/// <summary>ランチャーからの最終起動日時</summary>
|
||||
public DateTime? LastLaunched
|
||||
{
|
||||
get => _lastLaunched;
|
||||
set
|
||||
{
|
||||
if (_lastLaunched != value)
|
||||
{
|
||||
_lastLaunched = value;
|
||||
OnPropertyChanged();
|
||||
OnPropertyChanged(nameof(LastLaunchedDisplay));
|
||||
OnPropertyChanged(nameof(LastLaunchedCardDisplay));
|
||||
OnPropertyChanged(nameof(LastLaunchedDetailDisplay));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>フォルダ更新日時</summary>
|
||||
public DateTime? FolderLastModified
|
||||
{
|
||||
get => _folderLastModified;
|
||||
set
|
||||
{
|
||||
if (_folderLastModified != value)
|
||||
{
|
||||
_folderLastModified = value;
|
||||
OnPropertyChanged();
|
||||
OnPropertyChanged(nameof(FolderLastModifiedDisplay));
|
||||
OnPropertyChanged(nameof(FolderLastModifiedCardDisplay));
|
||||
OnPropertyChanged(nameof(FolderLastModifiedDetailDisplay));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>ゲームエンジンの種別</summary>
|
||||
public abstract GameEngineKind EngineKind { get; }
|
||||
|
||||
public bool IsTkoolOrTyrano => EngineKind is GameEngineKind.Tkool or GameEngineKind.Tyrano;
|
||||
public bool IsUnity => EngineKind == GameEngineKind.Unity;
|
||||
|
||||
public string LastLaunchedDisplay => LastLaunched.HasValue
|
||||
? LastLaunched.Value.ToString("yyyy/MM/dd HH:mm")
|
||||
: "未起動";
|
||||
|
||||
public string LastLaunchedCardDisplay => LastLaunched.HasValue
|
||||
? $"▶ {LastLaunched.Value:yy/MM/dd HH:mm}"
|
||||
: "▶ 未起動";
|
||||
|
||||
public string LastLaunchedDetailDisplay => LastLaunched.HasValue
|
||||
? LastLaunched.Value.ToString("yyyy/MM/dd HH:mm:ss")
|
||||
: "まだ起動されていません";
|
||||
|
||||
public string FolderLastModifiedDisplay => FolderLastModified.HasValue
|
||||
? FolderLastModified.Value.ToString("yyyy/MM/dd HH:mm")
|
||||
: "-";
|
||||
|
||||
public string FolderLastModifiedCardDisplay => FolderLastModified.HasValue
|
||||
? $"📁 {FolderLastModified.Value:yy/MM/dd HH:mm}"
|
||||
: "📁 -";
|
||||
|
||||
public string FolderLastModifiedDetailDisplay => FolderLastModified.HasValue
|
||||
? FolderLastModified.Value.ToString("yyyy/MM/dd HH:mm:ss")
|
||||
: "不明";
|
||||
|
||||
// ================= バッジ・UIバインディング共通仮想プロパティ =================
|
||||
/// <summary>ツクールMVか</summary>
|
||||
public virtual bool IsMV => false;
|
||||
|
||||
/// <summary>ツクールMZか</summary>
|
||||
public virtual bool IsMZ => false;
|
||||
|
||||
/// <summary>ティラノスクリプトか</summary>
|
||||
public virtual bool IsTyrano => false;
|
||||
|
||||
/// <summary>Unity IL2CPPか</summary>
|
||||
public virtual bool IsIL2CPP => false;
|
||||
|
||||
/// <summary>Unity Monoか</summary>
|
||||
public virtual bool IsMono => false;
|
||||
|
||||
/// <summary>Unity バックエンドバッジテキスト</summary>
|
||||
public virtual string BackendBadgeText => string.Empty;
|
||||
|
||||
/// <summary>Unity バージョン</summary>
|
||||
public virtual string UnityVersion
|
||||
{
|
||||
get => string.Empty;
|
||||
set { }
|
||||
}
|
||||
|
||||
/// <summary>Unity レジストリパス (HKCU)</summary>
|
||||
public virtual string RegistryPath => string.Empty;
|
||||
|
||||
/// <summary>Unity LocalLowパス</summary>
|
||||
public virtual string LocalLowPath => string.Empty;
|
||||
|
||||
/// <summary>Unity セーブデータ検出フラグ</summary>
|
||||
public virtual bool HasSaveData
|
||||
{
|
||||
get => false;
|
||||
set { }
|
||||
}
|
||||
|
||||
/// <summary>ASARパッケージ形式か</summary>
|
||||
public virtual bool IsAsar
|
||||
{
|
||||
get => false;
|
||||
set { }
|
||||
}
|
||||
|
||||
/// <summary>ASAR解凍済みか</summary>
|
||||
public virtual bool IsAsarExtracted
|
||||
{
|
||||
get => false;
|
||||
set { }
|
||||
}
|
||||
|
||||
/// <summary>ASARバッジのテキスト</summary>
|
||||
public virtual string AsarBadgeText => string.Empty;
|
||||
|
||||
/// <summary>ASARバッジの背景色</summary>
|
||||
public virtual Brush AsarBadgeBackground => Brushes.Transparent;
|
||||
|
||||
/// <summary>ASARバッジの可視性</summary>
|
||||
public virtual Visibility AsarBadgeVisibility => Visibility.Collapsed;
|
||||
|
||||
/// <summary>ASAR詳細状態テキスト</summary>
|
||||
public virtual string AsarDetailStatusText => string.Empty;
|
||||
|
||||
/// <summary>改造適用中か</summary>
|
||||
public virtual bool IsModded
|
||||
{
|
||||
get => false;
|
||||
set { }
|
||||
}
|
||||
|
||||
/// <summary>改造適用フラグ</summary>
|
||||
public virtual bool ApplyMod
|
||||
{
|
||||
get => false;
|
||||
set { }
|
||||
}
|
||||
|
||||
/// <summary>プラグイン設定項目リスト</summary>
|
||||
public virtual ObservableCollection<ModPluginOptionItem> PluginOptions
|
||||
{
|
||||
get => _emptyPluginOptions;
|
||||
set { }
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user