Skip to content

Commit

Permalink
Update codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
IviriusMain committed Jan 21, 2025
1 parent c34e89a commit ad5bf7f
Show file tree
Hide file tree
Showing 6 changed files with 170 additions and 7 deletions.
15 changes: 15 additions & 0 deletions Helpers/Modding/AppPackage.cs
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;
}
}
18 changes: 18 additions & 0 deletions Helpers/Modding/IFEOEntry.cs
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;
}
}
33 changes: 26 additions & 7 deletions Helpers/Modding/IReboundApp.cs
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; }
}
19 changes: 19 additions & 0 deletions Helpers/Modding/ReboundAppShortcut.cs
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;
}
}
77 changes: 77 additions & 0 deletions Helpers/Modding/StandardReboundApp.cs
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;
}
}
15 changes: 15 additions & 0 deletions Rebound/Apps/Defrag.cs
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()
{

}
];
}

0 comments on commit ad5bf7f

Please sign in to comment.