Skip to content

Commit

Permalink
Replaced IAfterLoad with IOnLoaded to remove unnecessary dependency o…
Browse files Browse the repository at this point in the history
…n generic dictionary.
  • Loading branch information
CptMoore committed Dec 12, 2024
1 parent 667af6f commit 2b8b510
Show file tree
Hide file tree
Showing 15 changed files with 30 additions and 30 deletions.
4 changes: 2 additions & 2 deletions source/Features/CriticalEffects/CriticalEffectsCustom.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace MechEngineer.Features.CriticalEffects;

[CustomComponent("CriticalEffects")]
public class CriticalEffectsCustom : SimpleCustomComponent, IAfterLoad, IIsDestroyed
public class CriticalEffectsCustom : SimpleCustomComponent, IOnLoaded, IIsDestroyed
{
public string[][] PenalizedEffectIDs { get; set; } = Array.Empty<string[]>();
public string[] OnDestroyedEffectIDs { get; set; } = Array.Empty<string>();
Expand All @@ -36,7 +36,7 @@ protected virtual UnitType GetUnitType()
[UsedBy(User.FieldRepairs)]
public int MaxHits => PenalizedEffectIDs.Length + 1;

public void OnLoaded(Dictionary<string, object> values)
public void OnLoaded()
{
if (!CriticalEffectsFeature.settings.DescriptionEnabled)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
namespace MechEngineer.Features.CustomCapacities.Aliases;

[CustomComponent("CarryCapacityFactor")]
public class CarryCapacityFactorCustom : SimpleCustomComponent, IValueComponent<float>, IAfterLoad
public class CarryCapacityFactorCustom : SimpleCustomComponent, IValueComponent<float>, IOnLoaded
{
private float Value;
public void LoadValue(float value)
{
Value = value;
}

public void OnLoaded(Dictionary<string, object> values)
public void OnLoaded()
{
Def.AddComponent(new CapacityModCustom
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace MechEngineer.Features.CustomCapacities.Aliases;

[CustomComponent("CarryHandCapacityChassisFactor")]
public class CarryHandCapacityChassisFactorCustom : SimpleCustomComponent, IValueComponent<float>, IAfterLoad
public class CarryHandCapacityChassisFactorCustom : SimpleCustomComponent, IValueComponent<float>, IOnLoaded
{
private float Value;

Expand All @@ -13,7 +13,7 @@ public void LoadValue(float value)
Value = value;
}

public void OnLoaded(Dictionary<string, object> values)
public void OnLoaded()
{
Def.AddComponent(new CapacityModCustom
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace MechEngineer.Features.CustomCapacities.Aliases;

[CustomComponent("CarryHandUsageCapacityFactor")]
public class CarryHandUsageCapacityFactorCustom : SimpleCustomComponent, IValueComponent<float>, IAfterLoad
public class CarryHandUsageCapacityFactorCustom : SimpleCustomComponent, IValueComponent<float>, IOnLoaded
{
private float Value;

Expand All @@ -13,7 +13,7 @@ public void LoadValue(float value)
Value = value;
}

public void OnLoaded(Dictionary<string, object> values)
public void OnLoaded()
{
Def.AddComponent(new CapacityModCustom
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace MechEngineer.Features.CustomCapacities.Aliases;

[CustomComponent("CarryHandUsage")]
public class CarryHandUsageCustom : SimpleCustomComponent, IValueComponent<float>, IAfterLoad
public class CarryHandUsageCustom : SimpleCustomComponent, IValueComponent<float>, IOnLoaded
{
private float Value;

Expand All @@ -13,7 +13,7 @@ public void LoadValue(float value)
Value = value;
}

public void OnLoaded(Dictionary<string, object> values)
public void OnLoaded()
{
Def.AddComponent(new CapacityModCustom
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace MechEngineer.Features.CustomCapacities.Aliases;

[CustomComponent("CarryHandUsageLeftOverTopOffFactor")]
public class CarryHandUsageLeftOverTopOffFactorCustom : SimpleCustomComponent, IValueComponent<float>, IAfterLoad
public class CarryHandUsageLeftOverTopOffFactorCustom : SimpleCustomComponent, IValueComponent<float>, IOnLoaded
{
private float Value;

Expand All @@ -13,7 +13,7 @@ public void LoadValue(float value)
Value = value;
}

public void OnLoaded(Dictionary<string, object> values)
public void OnLoaded()
{
Def.AddComponent(new CapacityModCustom
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace MechEngineer.Features.CustomCapacities.Aliases;

[CustomComponent("CarryLeftOverCapacityChassisFactor")]
public class CarryLeftOverCapacityChassisFactorCustom : SimpleCustomComponent, IValueComponent<float>, IAfterLoad
public class CarryLeftOverCapacityChassisFactorCustom : SimpleCustomComponent, IValueComponent<float>, IOnLoaded
{
private float Value;

Expand All @@ -13,7 +13,7 @@ public void LoadValue(float value)
Value = value;
}

public void OnLoaded(Dictionary<string, object> values)
public void OnLoaded()
{
Def.AddComponent(new CapacityModCustom
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace MechEngineer.Features.CustomCapacities.Aliases;

[CustomComponent("CarryLeftOverCapacity")]
public class CarryLeftOverCapacityCustom : SimpleCustomComponent, IValueComponent<float>, IAfterLoad
public class CarryLeftOverCapacityCustom : SimpleCustomComponent, IValueComponent<float>, IOnLoaded
{
private float Value;

Expand All @@ -13,7 +13,7 @@ public void LoadValue(float value)
Value = value;
}

public void OnLoaded(Dictionary<string, object> values)
public void OnLoaded()
{
Def.AddComponent(new CapacityModCustom
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace MechEngineer.Features.CustomCapacities.Aliases;

[CustomComponent("CarryLeftOverUsageCapacityFactor")]
public class CarryLeftOverUsageCapacityFactorCustom : SimpleCustomComponent, IValueComponent<float>, IAfterLoad
public class CarryLeftOverUsageCapacityFactorCustom : SimpleCustomComponent, IValueComponent<float>, IOnLoaded
{
private float Value;

Expand All @@ -13,7 +13,7 @@ public void LoadValue(float value)
Value = value;
}

public void OnLoaded(Dictionary<string, object> values)
public void OnLoaded()
{
Def.AddComponent(new CapacityModCustom
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace MechEngineer.Features.CustomCapacities.Aliases;

[CustomComponent("CarryLeftOverUsage")]
public class CarryLeftOverUsageCustom : SimpleCustomComponent, IValueComponent<float>, IAfterLoad
public class CarryLeftOverUsageCustom : SimpleCustomComponent, IValueComponent<float>, IOnLoaded
{
private float Value;

Expand All @@ -13,7 +13,7 @@ public void LoadValue(float value)
Value = value;
}

public void OnLoaded(Dictionary<string, object> values)
public void OnLoaded()
{
Def.AddComponent(new CapacityModCustom
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace MechEngineer.Features.CustomCapacities.Aliases;

[CustomComponent("CarryLeftOverUsageLeftOverTopOffFactor")]
public class CarryLeftOverUsageLeftOverTopOffFactorCustom : SimpleCustomComponent, IValueComponent<float>, IAfterLoad
public class CarryLeftOverUsageLeftOverTopOffFactorCustom : SimpleCustomComponent, IValueComponent<float>, IOnLoaded
{
private float Value;

Expand All @@ -13,7 +13,7 @@ public void LoadValue(float value)
Value = value;
}

public void OnLoaded(Dictionary<string, object> values)
public void OnLoaded()
{
Def.AddComponent(new CapacityModCustom
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace MechEngineer.Features.CustomCapacities.Aliases;

[CustomComponent("HeatSinkCapacity")]
public class HeatSinkCapacityCustom : SimpleCustomComponent, IValueComponent<float>, IAfterLoad
public class HeatSinkCapacityCustom : SimpleCustomComponent, IValueComponent<float>, IOnLoaded
{
private float Value;

Expand All @@ -13,7 +13,7 @@ public void LoadValue(float value)
Value = value;
}

public void OnLoaded(Dictionary<string, object> values)
public void OnLoaded()
{
Def.AddComponent(new CapacityModCustom
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace MechEngineer.Features.CustomCapacities.Aliases;

[CustomComponent("HeatSinkEngineAdditionalCapacity")]
public class HeatSinkEngineAdditionalCapacityCustom : SimpleCustomComponent, IValueComponent<float>, IAfterLoad
public class HeatSinkEngineAdditionalCapacityCustom : SimpleCustomComponent, IValueComponent<float>, IOnLoaded
{
private float Value;

Expand All @@ -13,7 +13,7 @@ public void LoadValue(float value)
Value = value;
}

public void OnLoaded(Dictionary<string, object> values)
public void OnLoaded()
{
Def.AddComponent(new CapacityModCustom
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace MechEngineer.Features.CustomCapacities.Aliases;

[CustomComponent("HeatSinkUsage")]
public class HeatSinkUsageCustom : SimpleCustomComponent, IValueComponent<float>, IAfterLoad
public class HeatSinkUsageCustom : SimpleCustomComponent, IValueComponent<float>, IOnLoaded
{
private float Value;

Expand All @@ -13,7 +13,7 @@ public void LoadValue(float value)
Value = value;
}

public void OnLoaded(Dictionary<string, object> values)
public void OnLoaded()
{
Def.AddComponent(new CapacityModCustom
{
Expand Down
4 changes: 2 additions & 2 deletions source/Features/OverrideDescriptions/BonusDescriptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
namespace MechEngineer.Features.OverrideDescriptions;

[CustomComponent("BonusDescriptions")]
public class BonusDescriptions : SimpleCustomComponent, IAdjustTooltipEquipment, IAdjustInventoryElement, IAfterLoad, IListComponent<string>
public class BonusDescriptions : SimpleCustomComponent, IAdjustTooltipEquipment, IAdjustInventoryElement, IOnLoaded, IListComponent<string>
{
public string[] Bonuses { get; set; } = null!;

Expand Down Expand Up @@ -51,7 +51,7 @@ public void AdjustInventoryElement(ListElementController_BASE_NotListView elemen
}
}

public void OnLoaded(Dictionary<string, object> values)
public void OnLoaded()
{
if (Bonuses.Length < 1)
{
Expand Down

0 comments on commit 2b8b510

Please sign in to comment.