Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
fix: add a defaultRotation Attribute.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Mar 1, 2023
1 parent 8b96ff0 commit 2c30477
Show file tree
Hide file tree
Showing 22 changed files with 43 additions and 25 deletions.
12 changes: 12 additions & 0 deletions RotationSolver/Attributes/DefaultRotationAttribute.cs
Original file line number Diff line number Diff line change
@@ -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
{
}
1 change: 1 addition & 0 deletions RotationSolver/Rotations/Healer/AST/AST_Default.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace RotationSolver.Rotations.Healer.AST;

[DefaultRotation]
[RotationDesc(ActionID.Divination)]
internal sealed class AST_Default : AST_Base
{
Expand Down
1 change: 1 addition & 0 deletions RotationSolver/Rotations/Healer/SCH/SCH_Default.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace RotationSolver.Rotations.Healer.SCH;

[DefaultRotation]
[RotationDesc(ActionID.ChainStratagem)]
internal sealed class SCH_Default : SCH_Base
{
Expand Down
1 change: 1 addition & 0 deletions RotationSolver/Rotations/Healer/SGE/SGE_Default.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

namespace RotationSolver.Rotations.Healer.SGE;

[DefaultRotation]
internal sealed class SGE_Default : SGE_Base
{
public override string GameVersion => "6.18";
Expand Down
4 changes: 2 additions & 2 deletions RotationSolver/Rotations/Healer/WHM/WHM_Default.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
6 changes: 1 addition & 5 deletions RotationSolver/Rotations/Magicial/BLM/BLM_Default.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<DescType, string> DescriptionDict => new SortedList<DescType, string>()
//{
// {DescType.HealSingle, $"{BetweenTheLines}, {Leylines}" }
//};

private static bool NeedToGoIce
{
get
Expand Down
2 changes: 2 additions & 0 deletions RotationSolver/Rotations/Magicial/BLU/BLU_Default.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using RotationSolver.Actions;
using RotationSolver.Attributes;
using RotationSolver.Commands;
using RotationSolver.Configuration.RotationConfig;
using RotationSolver.Data;
Expand All @@ -9,6 +10,7 @@

namespace RotationSolver.Rotations.RangedMagicial.BLU;

[DefaultRotation]
internal sealed class BLU_Default : BLU_Base
{
public override string GameVersion => "6.18";
Expand Down
3 changes: 1 addition & 2 deletions RotationSolver/Rotations/Magicial/RDM/RDM_Default.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
3 changes: 1 addition & 2 deletions RotationSolver/Rotations/Magicial/SMN/SMN_Default.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
1 change: 1 addition & 0 deletions RotationSolver/Rotations/Melee/DRG/DRG_Default.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

namespace RotationSolver.Rotations.Melee.DRG;

[DefaultRotation]
internal sealed class DRG_Default : DRG_Base
{
public override string GameVersion => "6.18";
Expand Down
5 changes: 3 additions & 2 deletions RotationSolver/Rotations/Melee/MNK/MNK_Default.cs
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
1 change: 1 addition & 0 deletions RotationSolver/Rotations/Melee/NIN/NIN_Default.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace RotationSolver.Rotations.Melee.NIN;

[DefaultRotation]
[RotationDesc(ActionID.Mug)]
internal sealed class NIN_Default : NIN_Base
{
Expand Down
2 changes: 2 additions & 0 deletions RotationSolver/Rotations/Melee/RPR/RPR_Default.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using RotationSolver.Actions;
using RotationSolver.Attributes;
using RotationSolver.Configuration.RotationConfig;
using RotationSolver.Data;
using RotationSolver.Helpers;
Expand All @@ -8,6 +9,7 @@

namespace RotationSolver.Rotations.Melee.RPR;

[DefaultRotation]
internal sealed class RPR_Default : RPR_Base
{
public override string GameVersion => "6.28";
Expand Down
2 changes: 2 additions & 0 deletions RotationSolver/Rotations/Melee/SAM/SAM_Default.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using RotationSolver.Actions;
using RotationSolver.Attributes;
using RotationSolver.Configuration.RotationConfig;
using RotationSolver.Data;
using RotationSolver.Helpers;
Expand All @@ -8,6 +9,7 @@

namespace RotationSolver.Rotations.Melee.SAM;

[DefaultRotation]
internal sealed class SAM_Default : SAM_Base
{
public override string GameVersion => "6.28";
Expand Down
4 changes: 2 additions & 2 deletions RotationSolver/Rotations/Ranged/BRD/BRD_Default.cs
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
2 changes: 2 additions & 0 deletions RotationSolver/Rotations/Ranged/DNC/DNC_Default.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
using RotationSolver.Actions;
using RotationSolver.Attributes;
using RotationSolver.Data;
using RotationSolver.Helpers;
using RotationSolver.Rotations.Basic;
using RotationSolver.Updaters;

namespace RotationSolver.Rotations.RangedPhysicial.DNC;

[DefaultRotation]
internal sealed class DNC_Default : DNC_Base
{
public override string GameVersion => "6.28";
Expand Down
4 changes: 2 additions & 2 deletions RotationSolver/Rotations/Ranged/MCH/MCH_Default.cs
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
3 changes: 1 addition & 2 deletions RotationSolver/Rotations/Tank/DRK/DRK_Default.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
3 changes: 1 addition & 2 deletions RotationSolver/Rotations/Tank/GNB/GNB_Default.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
3 changes: 1 addition & 2 deletions RotationSolver/Rotations/Tank/PLD/PLD_Default.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
3 changes: 1 addition & 2 deletions RotationSolver/Rotations/Tank/WAR/WAR_Default.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
2 changes: 2 additions & 0 deletions RotationSolver/Updaters/RotationUpdater.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Lumina.Data.Parsing;
using RotationSolver.Actions;
using RotationSolver.Attributes;
using RotationSolver.Data;
using RotationSolver.Rotations.CustomRotation;
using System;
Expand Down Expand Up @@ -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<DefaultRotationAttribute>() != null);
rotation ??= group.rotations.FirstOrDefault(r => r.GetType().Name.Contains("Default"));
rotation ??= group.rotations.FirstOrDefault();
return rotation;
Expand Down

0 comments on commit 2c30477

Please sign in to comment.