-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c34e89a
commit ad5bf7f
Showing
6 changed files
with
170 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#nullable enable | ||
|
||
namespace Rebound.Helpers.Modding; | ||
|
||
public partial class AppPackage | ||
{ | ||
public string? PackageFamilyName { get; set; } | ||
|
||
public string? PackageSource { get; set; } | ||
|
||
public bool IsInstalled() | ||
{ | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
#nullable enable | ||
|
||
namespace Rebound.Helpers.Modding; | ||
public partial class IFEOEntry | ||
{ | ||
public string? EntryName { get; set; } | ||
|
||
public bool IsIntact() | ||
{ | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,44 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Collections.Generic; | ||
|
||
#nullable enable | ||
|
||
namespace Rebound.Helpers.Modding; | ||
|
||
enum ReboundAppIntegrity | ||
public enum ReboundAppIntegrity | ||
{ | ||
Installed, | ||
Corrupt, | ||
NotInstalled | ||
} | ||
|
||
internal interface IReboundApp | ||
public enum InstallationTemplate | ||
{ | ||
Basic, | ||
Recommended, | ||
Complete, | ||
Extras | ||
} | ||
|
||
public interface IReboundRootApp | ||
{ | ||
public void Install(); | ||
|
||
public void Uninstall(); | ||
|
||
public ReboundAppIntegrity GetIntegrity(); | ||
} | ||
|
||
public interface IReboundPackagedApp : IReboundRootApp | ||
{ | ||
public List<AppPackage>? AppPackages { get; set; } | ||
} | ||
|
||
public interface IReboundShortcutsApp : IReboundRootApp | ||
{ | ||
public List<ReboundAppShortcut>? Shortcuts { get; set; } | ||
} | ||
|
||
public interface IReboundIFEOApp : IReboundRootApp | ||
{ | ||
public List<IFEOEntry>? IFEOEntries { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#nullable enable | ||
|
||
namespace Rebound.Helpers.Modding; | ||
|
||
public partial class ReboundAppShortcut | ||
{ | ||
public string? Path { get; set; } | ||
|
||
public string? OriginalIconSource { get; set; } | ||
|
||
public string? ModernIconSource { get; set; } | ||
|
||
public bool ReplaceExisting { get; set; } = true; | ||
|
||
public bool IsShortcutIconModernized() | ||
{ | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
#nullable enable | ||
|
||
namespace Rebound.Helpers.Modding; | ||
|
||
public partial class StandardReboundApp : IReboundPackagedApp, IReboundShortcutsApp, IReboundIFEOApp | ||
{ | ||
public virtual List<AppPackage>? AppPackages { get; set; } | ||
|
||
public virtual List<ReboundAppShortcut>? Shortcuts { get; set; } | ||
|
||
public virtual List<IFEOEntry>? IFEOEntries { get; set; } | ||
|
||
public void Install() | ||
{ | ||
|
||
} | ||
|
||
public void Uninstall() | ||
{ | ||
|
||
} | ||
|
||
public ReboundAppIntegrity GetIntegrity() | ||
{ | ||
if (AppPackages == null || Shortcuts == null || IFEOEntries == null) | ||
{ | ||
throw new InvalidOperationException("App packages and shortcuts must not be null."); | ||
} | ||
|
||
var isAppPackageIntact = true; | ||
var isShortcutIntact = true; | ||
var isIFEOEntryIntact = true; | ||
|
||
foreach (var appPackage in AppPackages) | ||
{ | ||
if (!appPackage.IsInstalled()) | ||
{ | ||
isAppPackageIntact = false; | ||
} | ||
} | ||
|
||
foreach (var shortcut in Shortcuts) | ||
{ | ||
if (!shortcut.IsShortcutIconModernized()) | ||
{ | ||
isShortcutIntact = false; | ||
} | ||
} | ||
|
||
foreach (var entry in IFEOEntries) | ||
{ | ||
if (!entry.IsIntact()) | ||
{ | ||
isIFEOEntryIntact = false; | ||
} | ||
} | ||
|
||
return | ||
// Check if everything is ok | ||
isShortcutIntact && isAppPackageIntact && isIFEOEntryIntact ? | ||
|
||
// All good | ||
ReboundAppIntegrity.Installed : | ||
|
||
// Check if nothing is ok | ||
!isShortcutIntact && !isAppPackageIntact && !isIFEOEntryIntact ? | ||
|
||
// Not installed | ||
ReboundAppIntegrity.NotInstalled : | ||
|
||
// Corrupt | ||
ReboundAppIntegrity.Corrupt; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using System.Collections.Generic; | ||
using CommunityToolkit.WinUI.UI.Controls.TextToolbarSymbols; | ||
using Rebound.Helpers.Modding; | ||
|
||
namespace Rebound.Apps; | ||
public partial class Defrag : StandardReboundApp | ||
{ | ||
public override List<ReboundAppShortcut> Shortcuts { get; set; } = | ||
[ | ||
new ReboundAppShortcut() | ||
{ | ||
|
||
} | ||
]; | ||
} |