diff --git a/RotationSolver/Attributes/DefaultRotationAttribute.cs b/RotationSolver/Attributes/DefaultRotationAttribute.cs new file mode 100644 index 000000000..37821f3da --- /dev/null +++ b/RotationSolver/Attributes/DefaultRotationAttribute.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace RotationSolver.Attributes; + +[AttributeUsage(AttributeTargets.Class)] +internal class DefaultRotationAttribute : Attribute +{ +} diff --git a/RotationSolver/Rotations/Healer/AST/AST_Default.cs b/RotationSolver/Rotations/Healer/AST/AST_Default.cs index 15052b9fc..7cea058e6 100644 --- a/RotationSolver/Rotations/Healer/AST/AST_Default.cs +++ b/RotationSolver/Rotations/Healer/AST/AST_Default.cs @@ -11,6 +11,7 @@ namespace RotationSolver.Rotations.Healer.AST; +[DefaultRotation] [RotationDesc(ActionID.Divination)] internal sealed class AST_Default : AST_Base { diff --git a/RotationSolver/Rotations/Healer/SCH/SCH_Default.cs b/RotationSolver/Rotations/Healer/SCH/SCH_Default.cs index 971f16615..8db49726a 100644 --- a/RotationSolver/Rotations/Healer/SCH/SCH_Default.cs +++ b/RotationSolver/Rotations/Healer/SCH/SCH_Default.cs @@ -11,6 +11,7 @@ namespace RotationSolver.Rotations.Healer.SCH; +[DefaultRotation] [RotationDesc(ActionID.ChainStratagem)] internal sealed class SCH_Default : SCH_Base { diff --git a/RotationSolver/Rotations/Healer/SGE/SGE_Default.cs b/RotationSolver/Rotations/Healer/SGE/SGE_Default.cs index 62c196216..9b2d315ab 100644 --- a/RotationSolver/Rotations/Healer/SGE/SGE_Default.cs +++ b/RotationSolver/Rotations/Healer/SGE/SGE_Default.cs @@ -12,6 +12,7 @@ namespace RotationSolver.Rotations.Healer.SGE; +[DefaultRotation] internal sealed class SGE_Default : SGE_Base { public override string GameVersion => "6.18"; diff --git a/RotationSolver/Rotations/Healer/WHM/WHM_Default.cs b/RotationSolver/Rotations/Healer/WHM/WHM_Default.cs index eebfa780b..f7f12c7ec 100644 --- a/RotationSolver/Rotations/Healer/WHM/WHM_Default.cs +++ b/RotationSolver/Rotations/Healer/WHM/WHM_Default.cs @@ -5,12 +5,12 @@ using RotationSolver.Data; using RotationSolver.Helpers; using RotationSolver.Rotations.Basic; -using RotationSolver.Rotations.CustomRotation; using RotationSolver.Updaters; -using System.Collections.Generic; using System.Linq; namespace RotationSolver.Rotations.Healer.WHM; + +[DefaultRotation] internal sealed class WHM_Default : WHM_Base { public override string GameVersion => "6.28"; diff --git a/RotationSolver/Rotations/Magicial/BLM/BLM_Default.cs b/RotationSolver/Rotations/Magicial/BLM/BLM_Default.cs index cda2ced13..7ef02eaa1 100644 --- a/RotationSolver/Rotations/Magicial/BLM/BLM_Default.cs +++ b/RotationSolver/Rotations/Magicial/BLM/BLM_Default.cs @@ -9,17 +9,13 @@ namespace RotationSolver.Rotations.RangedMagicial.BLM; +[DefaultRotation] internal class BLM_Default : BLM_Base { public override string GameVersion => "6.31"; public override string RotationName => "Default"; - //public override SortedList DescriptionDict => new SortedList() - //{ - // {DescType.HealSingle, $"{BetweenTheLines}, {Leylines}" } - //}; - private static bool NeedToGoIce { get diff --git a/RotationSolver/Rotations/Magicial/BLU/BLU_Default.cs b/RotationSolver/Rotations/Magicial/BLU/BLU_Default.cs index 367ceb48a..496b594f4 100644 --- a/RotationSolver/Rotations/Magicial/BLU/BLU_Default.cs +++ b/RotationSolver/Rotations/Magicial/BLU/BLU_Default.cs @@ -1,4 +1,5 @@ using RotationSolver.Actions; +using RotationSolver.Attributes; using RotationSolver.Commands; using RotationSolver.Configuration.RotationConfig; using RotationSolver.Data; @@ -9,6 +10,7 @@ namespace RotationSolver.Rotations.RangedMagicial.BLU; +[DefaultRotation] internal sealed class BLU_Default : BLU_Base { public override string GameVersion => "6.18"; diff --git a/RotationSolver/Rotations/Magicial/RDM/RDM_Default.cs b/RotationSolver/Rotations/Magicial/RDM/RDM_Default.cs index 0b8a74cf3..865430fe2 100644 --- a/RotationSolver/Rotations/Magicial/RDM/RDM_Default.cs +++ b/RotationSolver/Rotations/Magicial/RDM/RDM_Default.cs @@ -4,11 +4,10 @@ using RotationSolver.Data; using RotationSolver.Helpers; using RotationSolver.Rotations.Basic; -using RotationSolver.Rotations.CustomRotation; -using System.Collections.Generic; namespace RotationSolver.Rotations.RangedMagicial.RDM; +[DefaultRotation] [RotationDesc(ActionID.Embolden)] internal sealed class RDM_Default : RDM_Base { diff --git a/RotationSolver/Rotations/Magicial/SMN/SMN_Default.cs b/RotationSolver/Rotations/Magicial/SMN/SMN_Default.cs index 51e151c03..63826bce0 100644 --- a/RotationSolver/Rotations/Magicial/SMN/SMN_Default.cs +++ b/RotationSolver/Rotations/Magicial/SMN/SMN_Default.cs @@ -4,11 +4,10 @@ using RotationSolver.Data; using RotationSolver.Helpers; using RotationSolver.Rotations.Basic; -using RotationSolver.Rotations.CustomRotation; -using System.Collections.Generic; namespace RotationSolver.Rotations.RangedMagicial.SMN; +[DefaultRotation] [RotationDesc(ActionID.SearingLight)] internal sealed class SMN_Default : SMN_Base { diff --git a/RotationSolver/Rotations/Melee/DRG/DRG_Default.cs b/RotationSolver/Rotations/Melee/DRG/DRG_Default.cs index 36619fd0e..b799bff0a 100644 --- a/RotationSolver/Rotations/Melee/DRG/DRG_Default.cs +++ b/RotationSolver/Rotations/Melee/DRG/DRG_Default.cs @@ -10,6 +10,7 @@ namespace RotationSolver.Rotations.Melee.DRG; +[DefaultRotation] internal sealed class DRG_Default : DRG_Base { public override string GameVersion => "6.18"; diff --git a/RotationSolver/Rotations/Melee/MNK/MNK_Default.cs b/RotationSolver/Rotations/Melee/MNK/MNK_Default.cs index 1828b4acd..a90cb3627 100644 --- a/RotationSolver/Rotations/Melee/MNK/MNK_Default.cs +++ b/RotationSolver/Rotations/Melee/MNK/MNK_Default.cs @@ -1,16 +1,17 @@ using Dalamud.Game.ClientState.JobGauge.Enums; using RotationSolver.Actions; +using RotationSolver.Attributes; using RotationSolver.Commands; using RotationSolver.Configuration.RotationConfig; using RotationSolver.Data; using RotationSolver.Helpers; using RotationSolver.Rotations.Basic; -using RotationSolver.Rotations.CustomRotation; using System; -using System.Collections.Generic; using System.Linq; namespace RotationSolver.Rotations.Melee.MNK; + +[DefaultRotation] internal sealed class MNK_Default : MNK_Base { public override string GameVersion => "6.0"; diff --git a/RotationSolver/Rotations/Melee/NIN/NIN_Default.cs b/RotationSolver/Rotations/Melee/NIN/NIN_Default.cs index aaf8a5897..84f70e703 100644 --- a/RotationSolver/Rotations/Melee/NIN/NIN_Default.cs +++ b/RotationSolver/Rotations/Melee/NIN/NIN_Default.cs @@ -11,6 +11,7 @@ namespace RotationSolver.Rotations.Melee.NIN; +[DefaultRotation] [RotationDesc(ActionID.Mug)] internal sealed class NIN_Default : NIN_Base { diff --git a/RotationSolver/Rotations/Melee/RPR/RPR_Default.cs b/RotationSolver/Rotations/Melee/RPR/RPR_Default.cs index 48e99614c..df49cdd84 100644 --- a/RotationSolver/Rotations/Melee/RPR/RPR_Default.cs +++ b/RotationSolver/Rotations/Melee/RPR/RPR_Default.cs @@ -1,4 +1,5 @@ using RotationSolver.Actions; +using RotationSolver.Attributes; using RotationSolver.Configuration.RotationConfig; using RotationSolver.Data; using RotationSolver.Helpers; @@ -8,6 +9,7 @@ namespace RotationSolver.Rotations.Melee.RPR; +[DefaultRotation] internal sealed class RPR_Default : RPR_Base { public override string GameVersion => "6.28"; diff --git a/RotationSolver/Rotations/Melee/SAM/SAM_Default.cs b/RotationSolver/Rotations/Melee/SAM/SAM_Default.cs index 39cf254b9..7ff39b0c4 100644 --- a/RotationSolver/Rotations/Melee/SAM/SAM_Default.cs +++ b/RotationSolver/Rotations/Melee/SAM/SAM_Default.cs @@ -1,4 +1,5 @@ using RotationSolver.Actions; +using RotationSolver.Attributes; using RotationSolver.Configuration.RotationConfig; using RotationSolver.Data; using RotationSolver.Helpers; @@ -8,6 +9,7 @@ namespace RotationSolver.Rotations.Melee.SAM; +[DefaultRotation] internal sealed class SAM_Default : SAM_Base { public override string GameVersion => "6.28"; diff --git a/RotationSolver/Rotations/Ranged/BRD/BRD_Default.cs b/RotationSolver/Rotations/Ranged/BRD/BRD_Default.cs index 35d32356b..9f27e82e3 100644 --- a/RotationSolver/Rotations/Ranged/BRD/BRD_Default.cs +++ b/RotationSolver/Rotations/Ranged/BRD/BRD_Default.cs @@ -1,14 +1,14 @@ using Dalamud.Game.ClientState.JobGauge.Enums; using RotationSolver.Actions; +using RotationSolver.Attributes; using RotationSolver.Configuration.RotationConfig; using RotationSolver.Data; using RotationSolver.Helpers; using RotationSolver.Rotations.Basic; -using RotationSolver.Rotations.CustomRotation; -using System.Collections.Generic; namespace RotationSolver.Rotations.RangedPhysicial.BRD; +[DefaultRotation] internal sealed class BRD_Default : BRD_Base { public override string GameVersion => "6.28"; diff --git a/RotationSolver/Rotations/Ranged/DNC/DNC_Default.cs b/RotationSolver/Rotations/Ranged/DNC/DNC_Default.cs index c42ead5a7..055296d14 100644 --- a/RotationSolver/Rotations/Ranged/DNC/DNC_Default.cs +++ b/RotationSolver/Rotations/Ranged/DNC/DNC_Default.cs @@ -1,4 +1,5 @@ using RotationSolver.Actions; +using RotationSolver.Attributes; using RotationSolver.Data; using RotationSolver.Helpers; using RotationSolver.Rotations.Basic; @@ -6,6 +7,7 @@ namespace RotationSolver.Rotations.RangedPhysicial.DNC; +[DefaultRotation] internal sealed class DNC_Default : DNC_Base { public override string GameVersion => "6.28"; diff --git a/RotationSolver/Rotations/Ranged/MCH/MCH_Default.cs b/RotationSolver/Rotations/Ranged/MCH/MCH_Default.cs index f56b83fcb..8a14dd8a8 100644 --- a/RotationSolver/Rotations/Ranged/MCH/MCH_Default.cs +++ b/RotationSolver/Rotations/Ranged/MCH/MCH_Default.cs @@ -1,15 +1,15 @@ using RotationSolver.Actions; +using RotationSolver.Attributes; using RotationSolver.Configuration.RotationConfig; using RotationSolver.Data; using RotationSolver.Helpers; using RotationSolver.Rotations.Basic; -using RotationSolver.Rotations.CustomRotation; using RotationSolver.Updaters; -using System.Collections.Generic; using System.Linq; namespace RotationSolver.Rotations.RangedPhysicial.MCH; +[DefaultRotation] internal sealed class MCH_Default : MCH_Base { public override string GameVersion => "6.28"; diff --git a/RotationSolver/Rotations/Tank/DRK/DRK_Default.cs b/RotationSolver/Rotations/Tank/DRK/DRK_Default.cs index 7868f37aa..64d6720e5 100644 --- a/RotationSolver/Rotations/Tank/DRK/DRK_Default.cs +++ b/RotationSolver/Rotations/Tank/DRK/DRK_Default.cs @@ -5,13 +5,12 @@ using RotationSolver.Data; using RotationSolver.Helpers; using RotationSolver.Rotations.Basic; -using RotationSolver.Rotations.CustomRotation; using RotationSolver.Updaters; -using System.Collections.Generic; using System.Linq; namespace RotationSolver.Rotations.Tank.DRK; +[DefaultRotation] [RotationDesc(ActionID.BloodWeapon, ActionID.Delirium)] internal sealed class DRK_Default : DRK_Base { diff --git a/RotationSolver/Rotations/Tank/GNB/GNB_Default.cs b/RotationSolver/Rotations/Tank/GNB/GNB_Default.cs index 5edb8bc6b..f8c94fc20 100644 --- a/RotationSolver/Rotations/Tank/GNB/GNB_Default.cs +++ b/RotationSolver/Rotations/Tank/GNB/GNB_Default.cs @@ -4,11 +4,10 @@ using RotationSolver.Data; using RotationSolver.Helpers; using RotationSolver.Rotations.Basic; -using RotationSolver.Rotations.CustomRotation; -using System.Collections.Generic; namespace RotationSolver.Rotations.Tank.GNB; +[DefaultRotation] internal sealed class GNB_Default : GNB_Base { public override string GameVersion => "6.18"; diff --git a/RotationSolver/Rotations/Tank/PLD/PLD_Default.cs b/RotationSolver/Rotations/Tank/PLD/PLD_Default.cs index cacd38b72..9f8d565bf 100644 --- a/RotationSolver/Rotations/Tank/PLD/PLD_Default.cs +++ b/RotationSolver/Rotations/Tank/PLD/PLD_Default.cs @@ -4,11 +4,10 @@ using RotationSolver.Data; using RotationSolver.Helpers; using RotationSolver.Rotations.Basic; -using RotationSolver.Rotations.CustomRotation; -using System.Collections.Generic; namespace RotationSolver.Rotations.Tank.PLD; +[DefaultRotation] internal sealed class PLD_Default : PLD_Base { public override string GameVersion => "6.18"; diff --git a/RotationSolver/Rotations/Tank/WAR/WAR_Default.cs b/RotationSolver/Rotations/Tank/WAR/WAR_Default.cs index 67aea44ba..3eacef6be 100644 --- a/RotationSolver/Rotations/Tank/WAR/WAR_Default.cs +++ b/RotationSolver/Rotations/Tank/WAR/WAR_Default.cs @@ -4,13 +4,12 @@ using RotationSolver.Data; using RotationSolver.Helpers; using RotationSolver.Rotations.Basic; -using RotationSolver.Rotations.CustomRotation; using RotationSolver.Updaters; -using System.Collections.Generic; using System.Linq; namespace RotationSolver.Rotations.Tank.WAR; +[DefaultRotation] internal sealed class WAR_Default : WAR_Base { public override string GameVersion => "6.0"; diff --git a/RotationSolver/Updaters/RotationUpdater.cs b/RotationSolver/Updaters/RotationUpdater.cs index b8a5d6a68..09a1ee072 100644 --- a/RotationSolver/Updaters/RotationUpdater.cs +++ b/RotationSolver/Updaters/RotationUpdater.cs @@ -1,5 +1,6 @@ using Lumina.Data.Parsing; using RotationSolver.Actions; +using RotationSolver.Attributes; using RotationSolver.Data; using RotationSolver.Rotations.CustomRotation; using System; @@ -99,6 +100,7 @@ public static void UpdateRotation() internal static ICustomRotation GetChoosedRotation(CustomRotationGroup group, string name) { var rotation = group.rotations.FirstOrDefault(r => r.RotationName == name); + rotation ??= group.rotations.FirstOrDefault(r => r.GetType().GetCustomAttribute() != null); rotation ??= group.rotations.FirstOrDefault(r => r.GetType().Name.Contains("Default")); rotation ??= group.rotations.FirstOrDefault(); return rotation;