This repository has been archived by the owner on Aug 28, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: changed the way to add rotation config.
- Loading branch information
1 parent
baad8e5
commit 3f0d7e7
Showing
18 changed files
with
228 additions
and
272 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
19 changes: 19 additions & 0 deletions
19
RotationSolver.Basic/Attributes/RotationConfigAttribute.cs
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 @@ | ||
namespace RotationSolver.Basic.Attributes; | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
/// <param name="type"></param> | ||
[AttributeUsage(AttributeTargets.Property)] | ||
public class RotationConfigAttribute(CombatType type) : Attribute | ||
{ | ||
/// <summary> | ||
/// The type of this config. | ||
/// </summary> | ||
public CombatType Type => type; | ||
|
||
/// <summary> | ||
/// The display name for this config. | ||
/// </summary> | ||
public string Name { get; set; } = string.Empty; | ||
} |
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
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
77 changes: 69 additions & 8 deletions
77
RotationSolver.Basic/Configuration/RotationConfig/RotationConfigBase.cs
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
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
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
17 changes: 8 additions & 9 deletions
17
RotationSolver.Basic/Configuration/RotationConfig/RotationConfigComparer.cs
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,15 +1,14 @@ | ||
using System.Diagnostics.CodeAnalysis; | ||
|
||
namespace RotationSolver.Basic.Configuration.RotationConfig | ||
namespace RotationSolver.Basic.Configuration.RotationConfig; | ||
|
||
internal class RotationConfigComparer : IEqualityComparer<IRotationConfig> | ||
{ | ||
internal class RotationConfigComparer : IEqualityComparer<IRotationConfig> | ||
public bool Equals(IRotationConfig? x, IRotationConfig? y) | ||
{ | ||
public bool Equals(IRotationConfig? x, IRotationConfig? y) | ||
{ | ||
if (x == null || y == null) return false; | ||
return x.Name.Equals(y.Name); | ||
} | ||
|
||
public int GetHashCode([DisallowNull] IRotationConfig obj) => obj.Name.GetHashCode(); | ||
if (x == null || y == null) return false; | ||
return x.Name.Equals(y.Name); | ||
} | ||
|
||
public int GetHashCode([DisallowNull] IRotationConfig obj) => obj.Name.GetHashCode(); | ||
} |
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
Oops, something went wrong.